cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
UluruRob
Helper II
Helper II

String was not recognized as a valid DateTime. clientRequestId: 47a3437b-e81b-49c6-8bf7-0e0cbb2f5c06

Hi,

 

I am very new to Power Automate and this is one of my first flows, it is getting stuck at the final step of creating a Calendar Event because of this invalid date time error. I am trying to get the Dynamic Date Contents values from a Cognito forms to create the Calendar Event. I have attached the Flow and the Error details below. I am using compose actions before the Create Event as for whatever reason the content is not available to add directly. Please help.

Flow1.jpgError1.jpg

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
UluruRob
Helper II
Helper II

Thanks again @eric-cheng I think we are getting close, the dates are now passing successfully after I also update format in Cognito and applied the expression, now if I want to add time to this expression how can I do that please, below is the date format date expression.

 

formatDateTime(triggerOutputs()?['body/LeaveRequestDetails/FormattedStartDate'],'yyyy-MM-dd')

View solution in original post

eric-cheng
Solution Sage
Solution Sage

Hi @UluruRob ,

 

formatDateTime(triggerOutputs()?['body/LeaveRequestDetails/FormattedStartDate'],'yyyy-MM-dd hh:mm tt')

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

View solution in original post

8 REPLIES 8
eric-cheng
Solution Sage
Solution Sage

Hi @UluruRob 

 

It appears in your Start Time and End Time, you are passing 2 date values into each field ie. Outputs and utcNow().


Can you remove the utcNow() expression and try again?

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

UluruRob
Helper II
Helper II

Thanks for the quick response Eric - I see that now but when I remove the utcNow() and save the flow I get another error - see below? I'm just going around in circles!

Error2.jpg

eric-cheng
Solution Sage
Solution Sage

Hi @UluruRob ,

 

You will just need to use a formatDateTime() expression.


Can you copy and paste an example date time output so I can test on my end.

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

UluruRob
Helper II
Helper II

Thanks @eric-cheng I am only capturing the date in the Cognito form in the format below - perhaps that is the issue that I need to capture date and time in the one output? I do have a Start and End time in the Cognito form can I create an expression that combines the two outputs Date & Time?

4/10/2021

 

eric-cheng
Solution Sage
Solution Sage

Hi @UluruRob ,

 

You will need to format your date still using formatDateTime() into the below format

 

ericcheng_0-1631163251175.png

 

You can still pass a date into Create Events.  It won't error but it will just create an event with the same start and end time.

ericcheng_1-1631163318492.png

 

To format the date, you can use formatDateTime(yourvaluefromcognito, 'yyyy-MM-dd')

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

 

UluruRob
Helper II
Helper II

Thanks again @eric-cheng I think we are getting close, the dates are now passing successfully after I also update format in Cognito and applied the expression, now if I want to add time to this expression how can I do that please, below is the date format date expression.

 

formatDateTime(triggerOutputs()?['body/LeaveRequestDetails/FormattedStartDate'],'yyyy-MM-dd')

View solution in original post

UluruRob
Helper II
Helper II

@eric-cheng Just to clarify the times are a Dynamic Content value also not the time of date entry - thanks.

eric-cheng
Solution Sage
Solution Sage

Hi @UluruRob ,

 

formatDateTime(triggerOutputs()?['body/LeaveRequestDetails/FormattedStartDate'],'yyyy-MM-dd hh:mm tt')

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,946)