In this blog post, we’ll show how to use Power Automate to convert a string with JSON content into a JSON object. Instead of the JSON Array, we will use the JSON Object.

Create a string variable and set its initial value to the JSON object. I’ve already initialized it. You might obtain this value from the API response during complex flows.

Add a Compose step with inputs that have the expression below.

json(variables(‘stringjson’))

You can use the JSON object that is produced by this Compose phase anywhere in the flow. I’m storing the Compose result to an Object variable for this example.

Next Run the flow and see the output

 

if the goal is to extract the data from the JSON. To extract the data using the schema, use Parse JSON. Use the example JSON payload to generate the schema.

I’m using the string variable directly in the parse JSON step. The variables will be generated by this Parse JSON output in line with what is specified in the schema.

In the Compose step, I am using the variable produced by the Parse JSON step.

Next, Run the flow and see the output.

For any Help or Queries Contact us Info@crmonce.com or +918096556344