“I need to process response from an HTTP request in Power Automate, but the Parse JSON action is asking me for Schema. What should I write there? Do I need to understanding coding to use it?“
The Power Automate flow itself will give you the JSON schema it needs. Once you configure your HTTP request, do a test run (icon in the top right corner. Expand the details of the HTTP request to get the content of its Body.
Go back to editing your flow, open the Parse JSON action and click Generate from sample.
Paste the Body content as the sample JSON Payload and click Done.
It’ll be converted into a valid Schema.
I don’t get a screen with Inputs and Outputs after running Test. It just says Flow ran successfully and clears the screen. Am I missing a step?
Hello Harry,
you need two steps in the flow: the trigger action and the action whose output you want to use in the ‘Parse JSON’. If it doesn’t show the result directly after the test run, go back to the flow page and check the ‘Run history’.
excellent assitance thank you very much
Hey,
How can I now access those attributes using foreach loop ?
Hello Nitin,
I don’t understand what attributes you’re trying to access.
Excellent contents, and thank you for sharing!
A follow up question. Is it possible to change type from string to number (or in general any data type) in the flow ? I did a quick test by manually changing the type after creating schema with payload, but it failed validation when re-ran the flow. It looks like flow configures the schema on its own.
Hello Wei,
I prefer to get the values directly as explained here as it saves many problems with the data types: https://tomriha.com/how-to-get-a-specific-value-from-a-json-object-in-power-automate/.
Otherwise you can change the type in a flow later using the int(…) or string(…) or the other type converting expressions.
Hello,
is it somehow possible to automatically create a JSON schema?
Specifically, I would like to process JSON dynamically. As of now, I always have to manually edit the flow and then generate the schema from an example. Is there any way to automate this?
Many thanks in advance,
Tom
Hello Thomas,
I never thought of doing it manually, but maybe that’s because I really don’t like the Parse JSON action, I prefer to use expressions to extract the data, maybe it’ll help also in your situation: https://tomriha.com/how-to-get-a-specific-value-from-a-json-object-in-power-automate/
Any way I can get the JSON schema from an email body? Looking to use the JSON payload t convert information in an email body (ie: string, email address, name,) and parse those out for JSON dynamic content, but can’t find the correct code to place in the payload for conversion to JSON format/schema. Loading HTML from email body gives a “syntaxError: unexected token ‘<' from the inital HTML code. Any help is appreciated.
Hello jared,
email body is html, json schema is for json, and I didn’t find a reliable way to convert html to json yet.