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

Formatedatetime ISO error

Hey,

 

I am having an issue with a date format, the captured date is parsed into . variable and has the format dd/mm/yyyy and i want to convert it to yyyy-mm-dd

 

I am using this expression - formatDateTime(variables('Hire_date'),'yyyy-MM-dd')

 

But thew compose action fails with 

 

Unable to process template language expressions in action 'Compose' inputs at line '1' and column '49609': 'In function 'formatDateTime', the value provided for date time string '23/11/2019' was not valid. The datetime string must match ISO 8601 format.'

 

I'm struggling to understand what I am doing wrong in the compose step.

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Formatedatetime ISO error

@Jonnyphoto 

See my example below and post here if you have additional questions.

ComposeDateTime1.jpg

 

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

Scott

View solution in original post

8 REPLIES 8
Super User
Super User

Re: Formatedatetime ISO error

Hi @Jonnyphoto 

 

You need to use convertTimeZone. See this link below.

 

https://powerusers.microsoft.com/t5/General-Power-Automate/Formatting-Date-And-time-in-MS-Flow/m-p/7...

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!



Highlighted
Jonnyphoto
Level: Powered On

Re: Formatedatetime ISO error

Hi,

 

No I don't think this answers the question.

 

I am trying to change 23/11/2019 to 2019-11-23

 

Thanks.

Jonnyphoto
Level: Powered On

Re: Formatedatetime ISO error

My compose step has this expression

 

convertTimeZone(variables('Hire_date'),'UTC','W. Europe Standard Time','yyyy-MM-dd')
 
but that fails with the same error
Super User
Super User

Re: Formatedatetime ISO error

@Jonnyphoto 

See my example below and post here if you have additional questions.

ComposeDateTime1.jpg

 

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

Scott

View solution in original post

jdrussell78
Level: Powered On

Re: Formatedatetime ISO error

Looking good
M_Asnawi
Level: Powered On

Re: Formatedatetime ISO error

Hi @ScottShearer ,

 

I've tried to follow your expressions, but for the 'New Date' box, I've encountered this error. 

 

Query Flow.PNG

 

May I know what I did wrong? I followed your steps exactly, just that the initial input I put my own data.

 

Input for Flow.PNG

 

Your soonest response is highly appreciated and thank you so much for the help.

Regards,

Nawi

 
 
Super User
Super User

Re: Formatedatetime ISO error

@M_Asnawi 

Please add the expressions that you used as comments in the compose action and post a screen shot.

 

 

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

Scott
M_Asnawi
Level: Powered On

Re: Formatedatetime ISO error

@ScottShearer 

 

Kindly find the comments below:

 

Query 1.PNGQuery 2.PNG

 

My sample data is as below:

 

Query 3.PNG

 

Thank you so much Scott for replying. I really appreciate it.

Regards,

Nawi

 

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

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 Solution Authors
Top Kudoed Authors
Users online (5,272)