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

Date Format in Microsoft Flow - String was not recognized as a valid DateTime.

I am currently trying to setup an outlook invitation as soon as somebody books annual leave in the HR system.

When somebody submits an annual leave request, the data (Leave Date, Name, Manager,Emails) will be picked up from Common Data Services and sent through as a outlook invite.

 

Flow1.PNG

 

On the End date I'm trying to add 23 hours on top of the date that is inputted.

Apparently the data picked up from CDS is not the correct format, please could somebody advise on what expression/formula I could use to fix this problem?

 

 

Thank you.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Date Format in Microsoft Flow - String was not recognized as a valid DateTime.

Hi @DavidDuchy 

I am making an assumption (which may be incorrect) based on the image you provided that you are setting the end date to the Dynamic Content value +23. In order to add hours to a date you should use the addHours expression. This takes a Date (your Dynamic Content) as the first parameter and then a number of hours to add as the second parameter. It will look something like the below.

 

addHours(DYNAMICCONTENT, 23)

 

This should be created in the expressions editor, replacing DYNAMICCONTENT with your Date Field that you wish to add the time to. In my example below I am just using a custom input as a placeholder value.

 

2020-01-21_11-59-41.gif

 

Hope that helps.

 


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

Proud to be a Flownaut!


Follow me on Twitter at @QG_LeeJHarris

Or on LinkedIn at in/leejharris

View solution in original post

2 REPLIES 2
Super User
Super User

Re: Date Format in Microsoft Flow - String was not recognized as a valid DateTime.

Hi @DavidDuchy 

I am making an assumption (which may be incorrect) based on the image you provided that you are setting the end date to the Dynamic Content value +23. In order to add hours to a date you should use the addHours expression. This takes a Date (your Dynamic Content) as the first parameter and then a number of hours to add as the second parameter. It will look something like the below.

 

addHours(DYNAMICCONTENT, 23)

 

This should be created in the expressions editor, replacing DYNAMICCONTENT with your Date Field that you wish to add the time to. In my example below I am just using a custom input as a placeholder value.

 

2020-01-21_11-59-41.gif

 

Hope that helps.

 


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

Proud to be a Flownaut!


Follow me on Twitter at @QG_LeeJHarris

Or on LinkedIn at in/leejharris

View solution in original post

DavidDuchy
Level: Powered On

Re: Date Format in Microsoft Flow - String was not recognized as a valid DateTime.

@LeeHarris ,

 

Thank you very much!

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

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!

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Users online (6,261)