cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

@formatDateTime in "Update File properties" Help needed

My Post

I posted in the "Connecting to Data" and it I still can not find an answer. Can some one help?

1 REPLY 1
v-yuazh-msft
Community Support
Community Support

Hi @Anonymous,

 

What is the value of your expression "triggerBody()?['Updatefileproperties_ModelYear']"?

 

For your error message "The template language function 'formatDateTime' expects its first parameter to be of type string. The provided value is of type 'Integer'", you must make sure the value of your expression "triggerBody()?['Updatefileproperties_ModelYear']" would be a string, since you want to formate the string to a date time, the staring should be datetime and should match ISO 8601 format.

 

I couldn't understand why are you would formate the date to only "yyyy",and would insert the "yyyy" to a date time type column in the sharepoint list.

 

If you would insert the "yyyy" to a date time type column in the sharepoint list, there is no any way to achieve your needs,because the "yyyy" String was not recognized as a valid DateTime.

 

Maybe you could formate the datetype value from powerapps to a type such as "yyyy/MM/dd", and you could refer to screenshot below to create the flow:

Capture.PNG

 

The expression should be:

formatDateTime(triggerBody()?['Updatefileproperties_ModelYear'],'yyyy-MM-dd')

 

 

Best regards,

Alice

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power Automate User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (38,147)