Data Operations — Compose, Parse JSON, Filter Array
Learn how to manipulate and transform data within your Logic Apps workflows using built-in data operation actions.
Prerequisites
- An Azure account with an active subscription
- Basic familiarity with Logic Apps (see previous tutorial)
- A Logic App (Consumption or Standard) created in the Azure portal
Sample Data
We'll use this sample order array throughout the tutorial:
[
{ "id": 1, "product": "Laptop", "price": 1200, "category": "Electronics", "inStock": true },
{ "id": 2, "product": "Desk Chair", "price": 350, "category": "Furniture", "inStock": true },
{ "id": 3, "product": "Monitor", "price": 800, "category": "Electronics", "inStock": false },
{ "id": 4, "product": "Notebook", "price": 15, "category": "Stationery", "inStock": true },
{ "id": 5, "product": "Keyboard", "price": 150, "category": "Electronics", "inStock": true }
]
1. Compose Action
The Compose action lets you create JSON objects, merge data, or construct any output without needing an external service.
Use Cases
- Build a JSON payload to pass to a later action
- Merge values from multiple sources into a single object
- Store intermediate calculations
Step-by-Step
- In your Logic App designer, click + New step.
- Search for Compose under Data Operations.
- In the Inputs field, enter your JSON object or expression.
Example — Create a JSON object:
{
"orderSummary": {
"totalItems": 5,
"generatedAt": "@{utcNow()}",
"source": "AzureIntegrationHub"
}
}
Example — Merge dynamic content:
{
"fullName": "@{triggerBody()?['firstName']} @{triggerBody()?['lastName']}",
"email": "@{triggerBody()?['email']}"
}

Tip: Use the Compose action output in subsequent steps by referencing
outputs('Compose').
2. Parse JSON Action
The Parse JSON action takes a JSON string or object and produces typed dynamic content you can use in later steps.
Step-by-Step
- Add a Parse JSON action (under Data Operations).
- In Content, select the output from a previous step (e.g., an HTTP response body).
- In Schema, provide the JSON schema.
Generating a JSON Schema from a Sample Payload
- Click Use sample payload to generate schema.
- Paste your sample JSON:
{
"id": 1,
"product": "Laptop",
"price": 1200,
"category": "Electronics",
"inStock": true
}
- Click Done. The schema is auto-generated:
{
"type": "object",
"properties": {
"id": { "type": "integer" },
"product": { "type": "string" },
"price": { "type": "integer" },
"category": { "type": "string" },
"inStock": { "type": "boolean" }
}
}

Using Dynamic Content After Parsing
Once parsed, each property (e.g., product, price) appears as selectable dynamic content in subsequent actions.

Tip: If your payload may have optional fields, set
"required": []in the schema or mark fields as nullable to avoid runtime failures.
3. Filter Array Action
The Filter Array action returns only the items from an array that match a specified condition.
Step-by-Step
- Add a Filter array action.
- In From, provide the source array (e.g., output of a Parse JSON or Compose action).
- Set the condition using the Advanced mode expression or the visual editor.
Example — Filter electronics that are in stock:
- From:
@body('Parse_JSON') - Condition:
@item()?['category']is equal toElectronicsAND@item()?['inStock']is equal totrue
Result:
[
{ "id": 1, "product": "Laptop", "price": 1200, "category": "Electronics", "inStock": true },
{ "id": 5, "product": "Keyboard", "price": 150, "category": "Electronics", "inStock": true }
]

4. Select Action
The Select action transforms each item in an array into a new shape (like a map function).
Step-by-Step
- Add a Select action.
- In From, provide the source array.
- In Map, define the output object shape using key-value pairs.
Example — Extract product name and price only:
- From:
@body('Filter_array') - Map:
| Key | Value |
|---|---|
| ProductName | @item()?['product'] |
| Price | @item()?['price'] |
Result:
[
{ "ProductName": "Laptop", "Price": 1200 },
{ "ProductName": "Keyboard", "Price": 150 }
]

5. Create CSV Table / Create HTML Table Actions
These actions convert an array of objects into a CSV string or an HTML table.
Create CSV Table
- Add a Create CSV table action.
- In From, provide the array (e.g., output of the Select action).
- Choose Automatic columns (uses all properties) or Custom to pick specific columns.
Output:
ProductName,Price
Laptop,1200
Keyboard,150
Create HTML Table
- Add a Create HTML table action.
- In From, provide the array.
- Choose column mode.
Output:
<table>
<thead><tr><th>ProductName</th><th>Price</th></tr></thead>
<tbody>
<tr><td>Laptop</td><td>1200</td></tr>
<tr><td>Keyboard</td><td>150</td></tr>
</tbody>
</table>

Tip: Combine the HTML table output with the Office 365 connector to send formatted email reports.
Complete Workflow Example
Here's the full flow combining all actions:
- Trigger — When an HTTP request is received (with the sample order array)
- Parse JSON — Parse the request body with the order schema
- Filter Array — Keep only Electronics items in stock
- Select — Map to
ProductNameandPrice - Create HTML Table — Generate a formatted table
- Send Email — Send the HTML table in an email body

Tips for JSON Schema Generation
- Always use Use sample payload to generate schema rather than writing schemas manually.
- Test with multiple sample payloads to ensure all possible fields are captured.
- For arrays, provide at least one item that includes all fields.
- Add
"required": []if fields may be missing at runtime. - Use
"type": ["string", "null"]for nullable fields.
Common Issues
| Issue | Cause | Solution |
|---|---|---|
| "Invalid type. Expected String but got Null" | A field is null but schema expects a string | Update schema to allow null: "type": ["string", "null"] |
| Parse JSON fails with "Invalid JSON" | Input is a string, not an object | Use json() expression to convert: json(triggerBody()) |
| Filter Array returns empty | Condition values are case-sensitive | Use toLower() on both sides of the comparison |
| Select action output has null values | Source property name has a typo | Verify property names match the parsed schema exactly |
| CSV table has wrong columns | Using Automatic mode with inconsistent objects | Switch to Custom columns and define explicitly |
| "ActionFailed" on Parse JSON | Schema mismatch with actual payload | Regenerate schema from a current sample payload |
Next Steps
- Previous: Connectors — HTTP, Office 365, SQL Server
- Next: Variables and Loops