cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BR1984
Level: Powered On

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
BR1984
Level: Powered On

Re: formatdatetime(utcnow)

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

9 REPLIES 9
Super User
Super User

Re: formatdatetime(utcnow)

@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
Highlighted
BR1984
Level: Powered On

Re: formatdatetime(utcnow)

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 

 

Super User
Super User

Re: formatdatetime(utcnow)

SharePoint dates are UTC formatted.

Have you tried formattting the date as “yyyy-MM-dd”?
BR1984
Level: Powered On

Re: formatdatetime(utcnow)

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

Re: formatdatetime(utcnow)

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.
BR1984
Level: Powered On

Re: formatdatetime(utcnow)

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.

 

 

Community Support Team
Community Support Team

Re: formatdatetime(utcnow)

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.
BR1984
Level: Powered On

Re: formatdatetime(utcnow)

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

whitelc
Level: Powered On

Re: formatdatetime(utcnow)

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!

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,496)