Overview
Parsing JSON in Power Automate allows you to extract data from API responses, Power Apps inputs, or other sources. The “Parse JSON” action converts JSON into structured data that can be used in conditions, loops, and other actions.
When to Use “Parse JSON” in Power Automate?
Extracting data from API responses
Parsing JSON data from Power Apps
Handling JSON content from Microsoft Forms, SharePoint, or OneDrive
Using JSON data in variables, conditions, or loops
1️⃣ Understanding JSON Structure
JSON (JavaScript Object Notation) is a structured format with key-value pairs.
Example JSON Response (API)
jsonCopyEdit{
"user": {
"id": 1,
"name": "John Doe",
"email": "john@example.com"
}
}
Example JSON Array (Multiple Items)
[
{
"id": 1,
"name": "John Doe",
"email": "john@example.com"
},
{
"id": 2,
"name": "Jane Smith",
"email": "jane@example.com"
}
]
2️⃣ Steps to Parse JSON in Power Automate
Step 1: Add the “Parse JSON” Action
- Open Power Automate
- Create a new flow (Manual, Automated, or Scheduled)
- Add an action: “Parse JSON”
Step 2: Configure the “Parse JSON” Action
The “Parse JSON” action needs:
The Content (JSON data to be parsed)
A Schema (Defines the JSON structure)
Example: Parsing API Response
Field | Value |
---|---|
Content | Body (from previous API action) |
Schema | Auto-generated using a sample JSON |
Step 3: Generate JSON Schema Automatically
- Click “Generate from sample” in the “Parse JSON” action
- Paste a sample JSON response
- Click “Done” to auto-generate the schema
Example Generated Schema
{
"type": "object",
"properties": {
"user": {
"type": "object",
"properties": {
"id": { "type": "integer" },
"name": { "type": "string" },
"email": { "type": "string" }
}
}
}
}
3️⃣ Using Parsed JSON Data in Power Automate
Once parsed, the JSON data can be used dynamically.
Example: Extract User Email
- Use Dynamic Content →
user email
- Add an action: “Send an Email”
- To:
user email
(from parsed JSON) - Subject:
"Welcome, user name!"
- To:
Example: Loop Through JSON Array
If the JSON contains an array, use “Apply to Each”:
JSON Input | Action |
---|---|
Body from API | Parse JSON |
Parsed JSON (Array) | Apply to Each |
Inside Loop | Use Dynamic Content (e.g., name , email ) |
Example: Send an email to multiple users from API response
- Trigger: Get users from API
- Parse JSON
- Apply to Each (Users List)
- Send an Email (To: user email)
4️⃣ Best Practices for Parsing JSON in Power Automate
Always Generate Schema – Avoid manual JSON schema creation.
Use “Try-Catch” for Errors – Handle errors when parsing JSON using “Scope” with “Configure Run After”.
Validate JSON Before Parsing – Use a Condition action to check if JSON is valid.
Use “Apply to Each” for Arrays – Loop through JSON arrays properly.
Test with Sample Data – Ensure your schema matches the expected JSON format.