cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
erron000
New Member

MS Flow - Expected String, got StartObject

Building a flow from a JSON HTTP request, i can get all the string data fine but a entry called 'id' which looks like a number type is giving an error when i do a Parse JSON;

 

InvalidTemplate. Unable to process template language expressions in action 'Parse_JSON' inputs at line '1' and column '2889': 'Unexpected token encountered when reading value for 'id'. Expected String, got StartObject. Path 'schema.id'.'.

 

schema is as follows

 

{
"created_at": {
"type": "string"
},
"href": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
 
i have tried setting the id type to number but get the same error. The JSON outputs look like this:
 
{
"custom": null,
"id": 2747151,
"name": "L-3CW86S2",
etc
etc
1 ACCEPTED SOLUTION

Accepted Solutions
yashag2255
Dual Super User II
Dual Super User II

Hey @erron000 

 

Can you share details on how you are providing the schema for the parse JSON action? I would first create the flow with the HTTP trigger and add a compose action. Trigger the flow and get the body of the trigger in the compose action. From the flow run history, copy everything from the compose action output and then in the flow editor, add the parse json action and for the schema provide a sample data payload and add everything from the compose action over here. This matches exact key value pairs that you can use in the consecutive actions. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

2 REPLIES 2
yashag2255
Dual Super User II
Dual Super User II

Hey @erron000 

 

Can you share details on how you are providing the schema for the parse JSON action? I would first create the flow with the HTTP trigger and add a compose action. Trigger the flow and get the body of the trigger in the compose action. From the flow run history, copy everything from the compose action output and then in the flow editor, add the parse json action and for the schema provide a sample data payload and add everything from the compose action over here. This matches exact key value pairs that you can use in the consecutive actions. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

I got the schema from the HTTP results, gives same result as the Compose but copy/paste into schema shows the correct object types now and id is being accepted in JSON Parse.

 

Thanks!

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (69,078)