Introduction
Microsoft Power Automate is a workflow automation platform that helps users automate repetitive tasks and integrate different applications and services. During workflow execution, data is frequently exchanged between systems in JSON (JavaScript Object Notation) format.
The Parse JSON action in Power Automate is used to interpret JSON-formatted data and make its properties available as dynamic content for subsequent actions. It helps users access specific values from complex JSON objects, arrays, and nested structures without manually extracting each property.
For example, when an API, Power Apps, an AI Builder action, or another flow returns JSON data, the Parse JSON action can identify properties such as VendorName, Email, Amount, and Status. These values can then be used in conditions, loops, SharePoint operations, email notifications, and other workflow actions.
This article explains how the Parse JSON action works and how to implement it in a real-world Power Automate flow.
What Is Parse JSON?
Parse JSON is a Data Operation action in Power Automate that converts a JSON-formatted input into structured data that the flow can reference.
JSON consists of key-value pairs, arrays, and nested objects. Parse JSON uses a schema to understand the expected structure and data types of the incoming content.
For example, consider the following JSON data:
{
"VendorName": "ABC Technologies",
"Email": "[email protected]",
"Amount": 25000,
"Status": "Approved"
}
After parsing this JSON, Power Automate can expose the following properties as dynamic content:
- VendorName
- Email
- Amount
- Status
These properties can then be used in subsequent actions, such as creating a SharePoint item or sending an email.
Why Do We Use Parse JSON?
Parse JSON is useful when a flow receives structured data from another system and needs to access individual properties.
The primary benefits include:
- Access structured data: Extract individual properties from JSON input.
- Use dynamic content: Make JSON properties available for subsequent actions.
- Handle complex responses: Work with nested objects and arrays.
- Integrate external systems: Process API responses, AI-generated output, and data returned by other flows.
- Improve readability: Use clearly named properties instead of repeatedly writing complex expressions.
- Support automated processing: Use parsed values in conditions, loops, SharePoint operations, and notifications.
Understanding the Parse JSON Action
The Parse JSON action has two main inputs.
Content
The Content field contains the JSON data that needs to be parsed. It may come from:
- An HTTP response
- A Power Apps trigger
- A Compose action
- An AI Builder action
- A child flow
- A SharePoint column containing JSON text
- Another action that returns JSON
Schema
The Schema field defines the expected JSON structure, including property names, data types, arrays, and nested objects.
For example:
{
"type": "object",
"properties": {
"VendorName": {
"type": "string"
},
"Email": {
"type": "string"
},
"Amount": {
"type": "number"
},
"Status": {
"type": "string"
}
}
}
This schema tells Power Automate that the input contains a JSON object with four properties and their expected data types.
Step-by-Step Implementation
In this example, a flow receives vendor information in JSON format, parses the data, and creates a SharePoint list item.
Step 1: Create an Automated Cloud Flow
- Open Power Automate.
- Select Create.
- Choose Instant cloud flow.
- Enter the flow name:
ParseJSON_VendorDetails. - Select the Manually trigger a flow trigger.
- Select Create.
Step 2: Add a Compose Action
- Select New step.
- Search for Compose under Data Operations.
- Rename the action to
Compose_Vendor_JSON. - Enter the following sample JSON into the Inputs field:
{
"VendorName": "ABC Technologies",
"Email": "[email protected]",
"Amount": 25000,
"Status": "Approved"
}
The Compose action provides sample JSON data for testing.
Step 3: Add the Parse JSON Action
- Select New step.
- Search for Parse JSON under Data Operations.
- Rename the action to
Parse_JSON_VendorDetails. - In the Content field, select the Outputs dynamic content from
Compose_Vendor_JSON.
Alternatively, use the following expression:
outputs('Compose_Vendor_JSON')
- In the Schema field, select Generate from sample.
- Paste the sample JSON from Step 2.
- Select Done.
Power Automate generates the schema based on the sample structure.
Step 4: Add a Compose Action to Read the Vendor Name
- Add another Compose action.
- Rename it to
Compose_VendorName. - In the Inputs field, select the
VendorName dynamic content from Parse_JSON_VendorDetails.
You can also use this expression:
body('Parse_JSON_VendorDetails')?['VendorName']
The expression retrieves the VendorName property from the parsed JSON body.
Step 5: Add a Condition
Add a Condition action to check whether the vendor status is Approved.
Use the following expression on the left side:
body('Parse_JSON_VendorDetails')?['Status']
Set the condition to:
- Operator: is equal to
- Value:
Approved
If the condition is true, the flow can create a SharePoint item or send an approval notification.
If the condition is false, the flow can send a different notification or update the item's status.
Step 6: Create a SharePoint List Item
In the Yes branch:
- Add the SharePoint – Create item action.
- Select the SharePoint site.
- Select the Vendor Details list.
- Map the columns as follows:
| SharePoint column | Parsed JSON value |
|---|
| Title | VendorName |
| Email | Email |
| Amount | Amount |
| Status | Status |
Use the corresponding dynamic content from the Parse JSON action.
Step 7: Save and Test the Flow
- Select Save.
- Select Test.
- Run the flow manually.
- Review the execution history.
- Open the Parse JSON action and confirm that the output contains the expected properties.
- Verify that the SharePoint item was created successfully.
Expected parsed output:
{
"VendorName": "ABC Technologies",
"Email": "[email protected]",
"Amount": 25000,
"Status": "Approved"
}
Understanding JSON Arrays
A JSON array contains multiple items. In Power Automate, arrays are commonly used when an API returns multiple records.
Example:
{
"Vendors": [
{
"VendorName": "ABC Technologies",
"Amount": 25000
},
{
"VendorName": "XYZ Solutions",
"Amount": 35000
}
]
}
The schema for this structure can be generated from the sample. Its essential structure is:
{
"type": "object",
"properties": {
"Vendors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"VendorName": {
"type": "string"
},
"Amount": {
"type": "number"
}
}
}
}
}
}
How to Process the Array
- Add the Parse JSON action.
- Provide the JSON content and schema.
- Add an Apply to each action.
- Select the
Vendors array from the parsed output. - Inside the loop, use
VendorName and Amount from the current item. - Create a separate SharePoint item for each vendor if required.
You can also reference an array using:
body('Parse_JSON_VendorDetails')?['Vendors']
Within the Apply to each loop, the current vendor's name can be accessed using:
items('Apply_to_each')?['VendorName']
Replace Apply_to_each with the actual internal name of your loop.
Understanding Nested JSON Objects
JSON can contain objects inside other objects.
Example:
{
"VendorName": "ABC Technologies",
"Contact": {
"Email": "[email protected]",
"Phone": "9876543210"
}
}
After generating the schema, you can access nested properties using expressions.
To retrieve the vendor name:
body('Parse_JSON_VendorDetails')?['VendorName']
To retrieve the contact email:
body('Parse_JSON_VendorDetails')?['Contact']?['Email']
To retrieve the contact phone number:
body('Parse_JSON_VendorDetails')?['Contact']?['Phone']
The question mark (?) provides null-safe property access. It helps avoid certain errors when a property or parent object is missing or null, although it does not resolve every possible type or schema mismatch.
Using Parse JSON with Power Apps
Parse JSON can be useful when a Power Apps application sends structured data to a Power Automate flow.
For example, Power Apps may send selected vendor details as a JSON string.
Example Power Apps formula:
Set(
varVendorJSON,
JSON(
{
VendorName: "ABC Technologies",
Email: "[email protected]",
Amount: 25000
},
JSONFormat.Compact
)
);
ParseJSON_VendorDetails.Run(varVendorJSON)
In this example, ParseJSON_VendorDetails represents a flow that accepts a text input.
Inside the flow:
- Configure the Power Apps (V2) trigger with a Text input.
- Use the trigger's text input as the Parse JSON Content.
- Generate the schema from a representative JSON sample.
- Use the parsed properties in SharePoint, email, or other actions.
Important: The example assumes that the flow trigger accepts one text parameter. The actual .Run() argument and trigger input names must match the flow configuration.
Power Apps also has its own ParseJSON() function for interpreting JSON in a canvas app. This is separate from the Parse JSON action in Power Automate.
Using Parse JSON with AI Builder or AI-Generated Output
In AI-based workflows, an AI action may return structured information about an uploaded document.
For example, an RFP or proposal processing flow may receive:
{
"DocumentType": "Proposal",
"VendorName": "ABC Technologies",
"TotalCost": 250000,
"DeliveryTimeline": "12 weeks",
"TechnicalScore": 85
}
The flow can use Parse JSON to access these values and save them in the appropriate SharePoint columns.
Typical workflow:
- Upload the RFP or proposal document.
- Extract document content using an appropriate AI action.
- Obtain structured JSON output.
- Parse the JSON using a schema that matches the expected structure.
- Map the extracted properties to SharePoint columns.
- Use conditions to validate required values.
- Continue the scoring or recommendation process.
Important: If the AI action returns JSON as a text string, use that string as the Content input. If it returns an object or exposes a specific structured output, use the appropriate output directly. If the response includes Markdown code fences or explanatory text around the JSON, clean or restructure it before parsing.
For dynamic RFP criteria, the schema should describe the stable structure of the response. Individual criterion names can be returned as array items rather than being hard-coded as separate JSON properties.
Handling Missing or Null Values
A common problem occurs when a JSON property is missing or its value is null.
For example:
{
"VendorName": "ABC Technologies",
"Amount": null
}
If a property may be null, the schema can allow both its expected type and null.
For the Amount property:
{
"type": ["number", "null"]
}
If the property may be absent entirely, it should not be included in the schema's required array.
For example:
{
"type": "object",
"properties": {
"VendorName": {
"type": "string"
},
"Amount": {
"type": ["number", "null"]
}
},
"required": ["VendorName"]
}
You can then use an expression such as:
coalesce(body('Parse_JSON_VendorDetails')?['Amount'], 0)
This expression returns 0 when the Amount value is null or missing. Use a default value only when it is appropriate for the business requirement; zero should not automatically replace an unknown financial amount.
Common Parse JSON Errors and Solutions
Error 1: Invalid JSON
Cause: The input is malformed, such as missing quotation marks, commas, or closing braces.
Solution: Validate the input and ensure it contains valid JSON. Use a Compose action to inspect the raw output before parsing it.
Error 2: Schema Validation Failed
Cause: The actual data type does not match the schema. For example, the schema expects a number, but the input contains a string.
Solution: Check the incoming data and schema. If the source legitimately returns different types, define an appropriate schema or normalize the data before parsing.
Error 3: Property Not Found
Cause: An expression references a property that is missing, incorrectly named, or located at a different level of the JSON structure.
Solution: Inspect the actual output and verify the property name and nesting.
Example:
body('Parse_JSON_VendorDetails')?['VendorName']
Error 4: Null Value Error
Cause: A required property is missing or contains null.
Solution: Make the property optional where appropriate, allow null values in the schema, and use null-safe expressions or validation conditions.
Error 5: Array and Object Mismatch
Cause: The schema expects an object, but the source returns an array, or vice versa.
Solution: Inspect the input's root structure and generate the schema from a representative sample. A JSON object starts with {, while an array starts with [.
Error 6: Extra Text Around JSON
Cause: The source returns JSON together with explanatory text or Markdown code fences.
Solution: Configure the source to return only valid JSON when possible. Otherwise, extract the JSON portion using a reliable method before passing it to Parse JSON.
Error 7: Unexpected Property or Data Structure
Cause: The source has added, removed, or changed properties since the schema was created.
Solution: Review the latest input and update the schema to reflect the actual contract. For evolving structures, use optional properties and arrays where appropriate rather than requiring every possible field.
Conclusion
The Parse JSON action is an important data-processing feature in Microsoft Power Automate. It allows a flow to interpret JSON data and access individual properties through dynamic content and expressions.
By understanding the Content field, schema generation, JSON objects, arrays, nested properties, null handling, and error troubleshooting, developers can build more reliable automation workflows.
When used with SharePoint, Power Apps, APIs, and AI-based document processing, Parse JSON helps transform structured output into usable business data. Following appropriate schema design and validation practices ensures that flows remain easier to maintain and troubleshoot as requirements evolve.
Join the conversation! Your thoughts help the community grow.