cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
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
Highlighted
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

Highlighted
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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (9,454)