Parse JSON in Power Automate
Parse JSON in Power Automate
Understanding how to parse JSON in Power Automate is essential for working with APIs, webhooks, and dynamic data. JSON (JavaScript Object Notation) is the standard format used by most external services to transmit structured data. Parsing this data allows your flow to access and manipulate it effectively.
In this guide, you’ll learn what parsing JSON is, how to set it up in Power Automate, and how to use it to power intelligent automation.
📑 Table of Contents
- What Does “Parse JSON” Mean in Power Automate?
- Why You Need to Parse JSON in Power Automate
- Where JSON Data Comes From
- Step-by-Step: How to Parse JSON in Power Automate
- JSON Schema Explained
- Real-World Use Cases
- Expressions with Parse JSON
- Best Practices
- Common Pitfalls
- Summary
❓ What Does “Parse JSON” Mean in Power Automate?
When a flow receives a JSON object (usually from an HTTP action or trigger), it’s unstructured until parsed. The “Parse JSON” action tells Power Automate what the data looks like, so it can be accessed using dynamic fields or expressions.
In short:
Parsing JSON transforms raw data into usable tokens in your flow.
🤔 Why You Need to Parse JSON in Power Automate
You must parse JSON in Power Automate whenever you:
- Retrieve data from an API
- Process responses from connectors like HTTP, Outlook, SharePoint, or Power Apps
- Handle webhooks
- Need to access nested objects or arrays
- Prevent dynamic content from being blank or inaccessible
Without parsing, your flow can’t properly “understand” the response.
🌐 Where JSON Data Comes From
You might get JSON from:
Source | Example |
---|---|
HTTP Response | API call like Microsoft Graph, Twitter, OpenAI, etc. |
Power Apps Inputs | JSON passed as parameters |
SharePoint | Complex fields like people pickers or multi-select |
Dataverse | Lookup fields, relationships |
Webhooks | External apps sending event data |
⚙️ Step-by-Step: How to Parse JSON in Power Automate
🔹 Step 1: Add the Action “Parse JSON”
- Go to New Step → Data Operations → Parse JSON
- In Content, select the output that contains JSON (e.g., HTTP body)
🔹 Step 2: Generate a Schema
Click “Generate from sample” and paste a real JSON sample response.
Example JSON:
{
"id": "abc123",
"name": "Jane Doe",
"email": "jane@example.com"
}
Power Automate will automatically create a schema based on this structure.
🔹 Step 3: Use Parsed Data
After parsing, each field becomes available as dynamic content. You can reference them directly, such as:
name
email
id
Or in expressions:
body('Parse_JSON')?['email']
🧬 JSON Schema Explained
The schema tells Power Automate what kind of data to expect.
Example schema:
{
"type": "object",
"properties": {
"id": { "type": "string" },
"name": { "type": "string" },
"email": { "type": "string" }
}
}
Advanced tip: Use https://jsonschema.net to build schemas manually if needed.
💼 Real-World Use Cases
Use Case | Description |
---|---|
CRM Integration | Parse customer data from Dynamics or Salesforce APIs |
Ticketing System | Parse Zendesk or Freshdesk webhook responses |
Employee Lookup | Parse user data from Microsoft Graph API |
E-commerce | Parse order details from Shopify or WooCommerce |
Workflow Triggers | Parse webhook events from GitHub, Stripe, etc. |
🧪 Expressions with Parse JSON in Power Automate
Once the JSON is parsed, you can use expressions like:
Goal | Expression |
---|---|
Access simple field | body('Parse_JSON')?['name'] |
Access nested object | body('Parse_JSON')?['user']?['email'] |
Access array item | body('Parse_JSON')?['roles'][0] |
Default value fallback | coalesce(body('Parse_JSON')?['email'], 'unknown@example.com') |
Use Apply to each for arrays:
Apply to each: body('Parse_JSON')?['items']
✅ Best Practices for Using Parse JSON in Power Automate
- ✅ Use real sample data to generate schemas
- ✅ Avoid overcomplicated schemas — only parse what you need
- ✅ Always wrap fields with
coalesce()
orempty()
if optional - ✅ Store parsed data in Compose actions if reused
- ✅ Use scopes to organize parsing and error handling
⚠️ Common Pitfalls to Avoid
Mistake | Fix |
---|---|
Hardcoding wrong schema | Use “Generate from sample” with real data |
Not parsing JSON | Flow fails to find dynamic fields |
Parsing null or empty data | Use conditions or empty() to check before parsing |
Incorrect data types | Match string/number/boolean types in schema |
Accessing before parse | Ensure Parse JSON runs before using its output |
📘 Summary: Mastering Parse JSON in Power Automate
Knowing how to parse JSON in Power Automate opens the door to advanced automation with APIs, webhooks, and custom data.
You’ve learned:
- What the Parse JSON action does
- How to generate a schema
- Real-world use cases and best practices
- Common mistakes to watch out for
By mastering JSON parsing, you gain full control over dynamic data — no matter how complex the structure.