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

Issue ISO 8601 formatDateTime (Date from DatePicker in PowerApps)

I'm trying to transmit Start Date and End Date from DataPickers into SQL-Query in Power Automate.

 

But my flow executes with errors, when I choose the dates between 12 and 31.07. 

 

I convert date17.07.2020 into 2020-07-17 in power automate defining string variables and compose expressions:

formatDateTime(triggerBody()['sql-qury-execute_query'],'yyyy-dd-MM') 

 

I receive error message:

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

 
Currently there is no errors, when the start and end date are between 1.07 and 12.07.
 
Is it possible to define the DatePicker output format before transmitting them into Flow? 
 
 
 
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

 

Hi @Anonymous ,

 

Please try the following method and expression:

concat(split(outputs('Compose'),'.')[2],'-',split(outputs('Compose'),'.')[1],'-',split(outputs('Compose'),'.')[0])

1.PNG 

 

Best Regards,

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

View solution in original post

2 REPLIES 2
Community Support
Community Support

 

Hi @Anonymous ,

 

Please try the following method and expression:

concat(split(outputs('Compose'),'.')[2],'-',split(outputs('Compose'),'.')[1],'-',split(outputs('Compose'),'.')[0])

1.PNG 

 

Best Regards,

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

View solution in original post

Anonymous
Not applicable

Hi @v-bacao-msft,

Thanks a lot for your help!

Your method works in my case, when the browser language is german. 

 

Following expression works, if the input date format is July 29, 2020

formatDateTime(triggerBody()['sql-qury-execute_query'],'yyyy-dd-MM') 

 

I noticed, that if I set english language in my browser, the DataPicket in PowerApps transmit the in Format July 29, 2020. But if the browser language is german, the date format is 29.07.2020. Is it possible to recognise the date format in Power Automate with date template and execute different flow ways with if condition?

 

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!

Top Solution Authors
Users online (4,600)