Convert String to JSON in Power Automate
Introduction
Power Automate frequently processes data received from APIs, SharePoint, Dataverse, SQL Server, Forms, and external systems. In many situations, the data arrives as a plain text string even though it contains JSON content. To access individual properties and values, the string must first be converted into a JSON object. This is commonly achieved using the Parse JSON action.
What is JSON?
JSON (JavaScript Object Notation) is a structured format used to store and exchange data. Example: {"Name":"John","Department":"IT","Location":"London"} JSON makes it easy to access individual values and properties.
Why Convert String to JSON?
Many systems return data as text. Example: {"Name":"John","Department":"IT"} Although it contains JSON data, Power Automate treats it as a string. Before accessing values such as: Name, Department, Location, the string must be converted into a JSON object.
Solution Overview
Workflow: Receive String → Convert to JSON → Parse JSON → Extract Properties → Use Dynamic Content. This process allows Power Automate to work with structured data.
Step 1: Receive String Data
Example string: {"Name":"John","Department":"IT","Location":"London"} The value may come from: HTTP Request, API Response, SharePoint Column, Dataverse Field, SQL Server.
Step 2: Add Parse JSON Action
Search for: Parse JSON, Add the action to your flow. The Parse JSON action converts string-based JSON into usable structured content.
Step 3: Configure Content
Content: outputs('Compose') or triggerBody() depending on your source. This provides the JSON string to the Parse JSON action.
Step 4: Generate Schema
Click: Generate from Sample, Paste sample JSON: {"Name":"John","Department":"IT","Location":"London"} Power Automate automatically creates the schema. Example schema: {"type":"object","properties":{"Name":{"type":"string"},"Department":{"type":"string"},"Location":{"type":"string"}}}
Accessing JSON Values
After parsing: Dynamic Content becomes available. Examples: Name, Department, Location. These values can be used throughout the flow.
Working with API Responses
Many APIs return JSON as text. Workflow: HTTP Request → Response String → Parse JSON → Extract Values → Continue Processing. This is one of the most common Power Automate scenarios.
Working with SharePoint Data
Suppose a SharePoint column stores: {"Project":"CRM","Status":"Active"} Using Parse JSON: Project: CRM, Status: Active. The values become accessible individually.
Real-World Example
Employee Information API, API Response: {"EmployeeID":"1001","Name":"John","Department":"IT"} Workflow: Call API → Receive String → Parse JSON → Extract Employee Details → Update Dataverse Record. Result: Structured employee information is processed automatically.
Common Use Cases
- API Integrations
- SharePoint Automation
- Dataverse Integration
- Email Processing
- Reporting Solutions
Common Errors
- Invalid JSON Format
- Missing Schema Properties
- Empty Values
Best Practices
- Validate JSON Structure
- Use Sample Data
- Handle Exceptions
- Avoid Hardcoding
- Test with Real Data
Benefits
- Structured Data Processing
- Better Automation
- Faster Development
- Reliable Integrations
- Improved Maintainability