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
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (3,271)