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

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

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!

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
v-alzhan-msft
Community Support
Community Support

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.

Anonymous
Not applicable

Thank You, 

 

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

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!

Anonymous
Not applicable

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. 

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
Anonymous
Not applicable

same as what is suggested above: 

 

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

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (3,285)