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

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 III
Helper III

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 III
Helper III

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 III
Helper III

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 III
Helper III

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')
UluruRob
Helper III
Helper III

@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

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.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,815)