cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Slock
Frequent Visitor

Power Automate issues "reading" JSON date/time

Hello!

 

I am currently building a flow that will make a calendar event (Create a SharePoint item) which is triggered from receiving an email with important text information inside it. The important info in the email is the Title, Date/time, and Description of event. I will use this to create a calendar event for "Vacation time". Appreciate any feedback/advice/critics in advance, thanks!

 

The email looks like this...

"John Smith has submitted the following time off request which has been",
"auto-approved.",
"Reason: Flex Vacation",
"Time away net hours: 40",
"Time away start: 8/29/2022 12:00:00 AM",
"Time away end: 9/3/2022 12:00:00 AM",
"Time off employee message: See ya next week"

 

The current issue I'm having is the "Create an item" in SharePoint cannot read the information going into it. It gives an error of..."The 'inputs.parameters' of workflow operation 'Create_Calendar_Event' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'item/EventDate' is required to be of type 'String/date-time'. The source type/format 'Array' of the value '["2022-08-29T00:00:00.0000000"]' is not convertible to type/format 'String/date-time'."

 

Here are some screenshots of my current flow giving me this error...

Slock_0-1660335896692.png

 

Slock_1-1660335984078.png

Slock_2-1660336136612.png

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Slock
Frequent Visitor

@maxpower45255 

 

Figured the issue out! The inputs to creating a SharePoint calendar item need to be as this screenshot shows....

Slock_1-1660748044873.png

 

The inputs should NOT be in the format below

Slock_2-1660748214611.png

 

 

The last piece of the puzzle I was looking back and seeing the "API operation failure" error code. I didnt quit understand what this meant but happened upon a video showing sometimes flows wont work if the connections arent correct. Indeed, my connections were not correct! I was working on this flow with a coworker, and it was using his inbox/SharePoint. Therefore the connection needed to be going through his email. However, flow automatically assigned my email as the connector and thus the API failure.... The tricky part about this was when I remembered the API failure, I was receiving a 401 Error code and that was telling me "The response is not in JSON format". INSTEAD of the API failure appearing (shown below). Anyways, thank you for the help and I hope this is of help to any other users out there in need!

Slock_3-1660748538897.png

 

 

 

 

View solution in original post

4 REPLIES 4
maxpower45255
Advocate II
Advocate II

@Slock 

The error description is pointing to a data type conversion issue.  Whichever action you're reading the source information from, it's returning an array of dates instead of a string, thus the error. Take a look at the value of the date field. It shows the date inside "[ ]". That's the notation for an array.  

 

I have found that Power Automate does an excellent job in providing the description of the errors. I sometimes have to read twice to figure out the cause. But the error description always turned out to be accurate. Hope this helps. 

Good luck!

 Input parameter 'item/EventDate' is required to be of type 'String/date-time'. The source type/format 'Array' of the value '["2022-08-29T00:00:00.0000000"]' is not convertible to type/format 'String/date-time'." 

@maxpower45255 

 

Awesome, thank you! I believe I converted the variable back to a string using the String() command. But when I did this, it returned me an error saying the inputs were not valid JSON.

Slock_2-1660661537847.png

 

 

So then I attempted to turn all the inputs into JSON using the simple below manual format...

{

 "a": "b"

}

Slock_3-1660661772711.png

 

But got an "object" not converting to "string" error.

Slock_4-1660661952514.png

 

 

 

Lastly, when I tried to convert this format into JSON using the command in Power automate....it could not Parse due to the T as shown in this free online software... Also I read on other forums that the Date/time must be in the YYYY-MM-ddTAA:BB:CC.DDDDDDD format to be correctly used as the start/end date thus why I have been using this convention.

 

Slock_1-1660659055283.png

 

Thanks for the patience/help.

 

Slock
Frequent Visitor

@maxpower45255 

 

Figured the issue out! The inputs to creating a SharePoint calendar item need to be as this screenshot shows....

Slock_1-1660748044873.png

 

The inputs should NOT be in the format below

Slock_2-1660748214611.png

 

 

The last piece of the puzzle I was looking back and seeing the "API operation failure" error code. I didnt quit understand what this meant but happened upon a video showing sometimes flows wont work if the connections arent correct. Indeed, my connections were not correct! I was working on this flow with a coworker, and it was using his inbox/SharePoint. Therefore the connection needed to be going through his email. However, flow automatically assigned my email as the connector and thus the API failure.... The tricky part about this was when I remembered the API failure, I was receiving a 401 Error code and that was telling me "The response is not in JSON format". INSTEAD of the API failure appearing (shown below). Anyways, thank you for the help and I hope this is of help to any other users out there in need!

Slock_3-1660748538897.png

 

 

 

 

maxpower45255
Advocate II
Advocate II

@Slock That's great! any time. 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (3,067)