cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

formatdatetime(utcnow)

Hi all

 

I have a field called Date on my sharepoint list - and my flow is sending a email when that date is equel to Today date but it fail all the time as Date field is not formating in dd-MM-yyyy but in other format

 

my field is like this where weeks is my field name who contain the date like 30-08-2018

 

formatdatetime(triggerBody()?['weeks'],'dd-MM-yyyy') (but this fail)

 

but this one work when i try to take the Today date

formatDateTime(utcNow(),'dd-MM-yyyy')

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

Hi v-yamao-msft Thanks for that but its not true

 

I took the calculated column and convertet it with Date function and everythings work fine.

 

Thank for replay.

 

 

View solution in original post

10 REPLIES 10
Super User III
Super User III

@BR1984:

 

Can you post a screen shot of your Flow so that we can better assist?

 

Scott

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Skærmbillede 2018-08-30 kl. 20.20.49.png

Yes i can

 

I try to use compose to format the value of Sharepoint list who contain the date but the formating i output is wrong

the compose 1 when i format utcnow to dd-mm-yyyy is working great but its seems like its not the same when it comes from a list ?

The date who comes from sharepoint list is a calculated date column but the Microsoft Flow is reading that null ?

i dont get it - hope some one can help me 

 

Skilled Sharer
Skilled Sharer

SharePoint dates are UTC formatted.

Have you tried formattting the date as “yyyy-MM-dd”?
Frequent Visitor

Yes i have but it cant format it - the format is the function I write, I have try it with @ and without.

Hi @BR1984,

 

Which trigger are you using?

 

Do you want to get all the items first then find out the one which Week is equal to Today?

 

I have made the following test on my side, please take it for a reference.

 

The flow is triggered by a Button. Then Get items from the list.

 

Compose2 is used to format utcnow with the following code:

formatDateTime(utcNow(),'MM-dd-yyyy')

 

Compose is used to format Week, just make sure put it under action Apply to each.

formatDateTime(items('Apply_to_each')?['Week'],'MM-dd-yyyy')

 

If they have the same date, send a notification.

1.PNG

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for replay

 

i have just try it and i get a error

InvalidTemplate. Unable to process template language expressions in action 'Compose' inputs at line '1' and column '2507': 'The template language function 'formatDateTime' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#formatdatetime for usage details.'.

 

it seems like calculated column who called Weeks is null - but it not true the value is 31-08-2018.

 

 

Hi @BR1984,

 

Thanks for updating with more details.

 

Yes, Calculated column is currently not supported. So you will get the error message.

 

Please try to use a column of type date and time, which should work.

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi v-yamao-msft Thanks for that but its not true

 

I took the calculated column and convertet it with Date function and everythings work fine.

 

Thank for replay.

 

 

View solution in original post

Can you tell me how you converted the SharePoint calculated column to a date in Flow? I cannot get calculated dates from SharePoint list to format properly in a Flow-generated email.

 

I've tried various permutations of "formatDateTime" and get the same error others have mentioned: 

 

Unable to process template language expressions in action 'Compose_-_format_Hire_Date_+_3_Months' inputs at line '1' and column '2540': 'The template language function 'formatdatetime' expects its first parameter to be of type string. The provided value is of type 'Null'.

 

Thanks!

Continued Contributor
Continued Contributor

Generaly If you have in the flow date from UtcNow and expression calculates date you have to update item which column is formated as date. You have to open SharePoint list and go to the setting of the column.

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (4,187)