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

DateTime invalid String

Hi, 

I am receiving the following error "String was not recognized as a valid DateTime." I did a little research on here and attempted to insert a compose step, to no avail. (See below) 

 

In the excel spreadsheet formula bar, the date/time appears as follows: "3/15/2019 12:00:00 AM" ,but appears in the spreadsheet column like this 

3/15/2019 0:00

 

I'm not really sure where to go from here. I think both formats are pretty standard. Any suggestions? 

I also don't see the option of making the composed variable the return option for the Date column in "Create Item 2".

DateTime Problem.PNGMCL DateTime Problem.PNG

9 REPLIES 9
Highlighted
Super User III
Super User III

Re: DateTime invalid String

Hi @Anonymous 

 

Looks like your format date time is wrong. Try the below

 

formatDateTime(items('Apply_to_each')?['Incident Date'], 'yyyy-MM-ddThh:mm:ss')

 

When you use the above formatDateTime expression copy this under the expression next to the Dynamic Tab. Please see below

 

image.png

 

Next if you want to use the formatted date time in your next loop you need to use a variable before the List Rows. You can't use the compose output in next loop because the scope is local only. That means the current compose in your flow is subjected to that first loop only. Output of the first compose in a variable so that you will be able to use this in your next loop. Basically the new variable will work like a global variable for the flow which can be used anywhere in your flow action steps.

 

Hope it make sense.

 

Thanks

 

 



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!

Learn more from my blog

Power Automate Video Tutorials
Highlighted
Dual Super User III
Dual Super User III

Re: DateTime invalid String

Hi @Anonymous 

 

The excel date and time values work a little different in Flow. Here is a blog post that breaks it down and may help you resolve: https://www.bythedevs.com/post/working-with-date-time-data-of-excel-in-power-automate 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Highlighted
Super User III
Super User III

Re: DateTime invalid String

Hi @Anonymous 

 

 

@yashag2255  Of course I forgot to mention about the days add technique with excel. Thanks for the link. 

 

@Anonymous If you need any further help in this please let us know.

 

Thanks



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!

Learn more from my blog

Power Automate Video Tutorials
Highlighted
Community Support
Community Support

Re: DateTime invalid String

Hi @Anonymous ,

 

Please take a try with @abm  and @yashag2255 's solution and please feel free to reply here if you have any problems.

 

Best regards,

Alice       

 

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

Highlighted
Anonymous
Not applicable

Re: DateTime invalid String

Thank You, 

 

May I get a few more details on connecting the initialize variable step to the compose step? 

Highlighted
Dual Super User III
Dual Super User III

Re: DateTime invalid String

Hey @Anonymous 

 

Which one? Can you please share a screenshot? 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Highlighted
Anonymous
Not applicable

Re: DateTime invalid String

The flow is now working, but the date column is retursamedate1.PNGthe formula is the one provided above.the formula is the one provided above.ning the same date ('11/1/2018') in all the fields. 

Highlighted
Super User III
Super User III

Re: DateTime invalid String

Hi @Anonymous 

 

Could you please post your formatdatetime expression?

 

Thanks

 

 



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!

Learn more from my blog

Power Automate Video Tutorials
Highlighted
Anonymous
Not applicable

Re: DateTime invalid String

same as what is suggested above: 

 

formatDateTime(items('Compose_DateTime')?['Incident Date'], 'yyyy-MM-ddThh:mm:ss')

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.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,332)