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

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
Highlighted
Super User
Super User

Hi @Anonymous 

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
Highlighted
Super User
Super User

Hi @Anonymous 

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

Highlighted
Anonymous
Not applicable

@LeeHarris ,

 

Thank you very much!

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 Kudoed Authors
Users online (9,341)