Blog
Wild & Free Tools

Flatten Nested JSON in Power Automate, n8n, and Azure Logic Apps — Without a Function Node

Last updated: January 2026 7 min read
Quick Answer

Table of Contents

  1. Power Automate
  2. Azure Logic Apps
  3. n8n
  4. Azure Data Factory
  5. NiFi, Zapier, Make
  6. Debug workflow
  7. Frequently Asked Questions

Every workflow platform answers "flatten this nested JSON" differently. Power Automate has Select and Compose actions. Azure Logic Apps has Data Operations. n8n has Set and Function nodes. Azure Data Factory has a dedicated Flatten transformation. Make and Zapier do it through formula fields and data transformers. This post maps the pattern in each platform, plus when to skip them entirely and use our browser tool for quick debugging.

Power Automate — Select + Compose Pattern

Microsoft Power Automate does not have a one-click flatten action. The common pattern uses a Select action to project nested properties into flat ones:

Step 1. Parse the incoming JSON with a "Parse JSON" action. Generate schema from a sample — this is where the browser flatten helps: flatten your sample first to see what paths you are extracting.

Step 2. Add a Select action. In the "From" field, point to your array or object. In the Map, add one entry per flat field you need:

user_name: body('Parse_JSON')?['user']?['name']
user_city: body('Parse_JSON')?['user']?['address']?['city']

Step 3. For deeper nesting, chain expressions or use a Compose action for complex transformations.

The result is a flat object. If you need the whole payload flattened (not just specific paths), write an Office Script or Azure Function called from your flow — there is no native "flatten all" action.

Azure Logic Apps — Data Operations and Inline Code

Logic Apps uses the same expression engine as Power Automate. Patterns are similar, with a few Logic Apps specific options:

Select action: Same as Power Automate, map flat fields to nested paths.

Inline Code (JavaScript): Premium tier feature. Drop in a JS snippet that runs your own flatten function — effectively embedding the JavaScript flatten code inside the workflow.

Azure Function integration: For heavy lifting, call an Azure Function that runs the flatten logic. Logs and retries are handled by the Logic App.

Tip: Use our browser flattener on a representative sample first to confirm the output shape. That tells you exactly what fields your downstream actions should expect.

n8n — Set, Function, and Item Lists

n8n gives you more flexibility because it is built around JavaScript:

Set node: Map individual flat fields manually — tedious for deep nesting but clear for 5-10 fields.

Function node: Drop in a flatten helper and run it on items[0].json. The 15-line recursive function from our JavaScript flatten guide works directly.

Item Lists node: For array-of-objects input, split the array first, then flatten each item.

Example Function node:

function flatten(obj, prefix = '', res = {}) {
  for (const key of Object.keys(obj)) {
    const path = prefix ? prefix + '.' + key : key;
    const val = obj[key];
    if (typeof val === 'object' && val !== null && !Array.isArray(val)) {
      flatten(val, path, res);
    } else res[path] = val;
  }
  return res;
}
return items.map(i => ({ json: flatten(i.json) }));
Sell Custom Apparel — We Handle Printing & Free Shipping

Azure Data Factory and Synapse — Dedicated Flatten Transform

ADF and Synapse Mapping Data Flows include a dedicated Flatten transformation designed for nested arrays. Unlike the others, this is built for splitting arrays into rows, not just structural flattening.

Use it for: Nested JSON where an inner array should become multiple output rows. Example: each order in {"user": {"orders": [...]}} becomes a separate row with user info denormalized onto it.

Do not use it for: Simple structural flattening. That is done with a Derived Column and dot-path expressions (user.address.city). The Flatten transform specifically handles arrays.

ADF also supports Copy Activity with JSON source-to-tabular-sink mapping, which handles basic structural flattening at the copy level without a full Data Flow.

NiFi, Zapier, and Make

Apache NiFi: The FlattenJson processor is a built-in. Configure the delimiter (default dot) and whether to flatten arrays. This is the closest any workflow platform comes to a one-click flatten.

Zapier: No native flatten action. Use a Code by Zapier step with a small JavaScript or Python function. For simple cases, Zapier's Formatter can pull individual nested fields into flat output variables.

Make (formerly Integromat): Similar to Zapier — Iterator and Aggregator modules handle array structures, but structural flattening usually requires a Tools module with a formula or JavaScript action.

For any of these, debug your transformation by pasting a sample into our browser JSON Flattener first. That gives you the exact output shape to target in your mapping.

The Fastest Debug Loop When a Workflow Flatten Breaks

Workflow actions tend to fail silently — a null field somewhere in the nesting produces an empty output, and you spend 20 minutes hunting why.

The debug loop:

1. Capture the actual payload hitting your workflow (Power Automate runs history, n8n execution log, Logic Apps trigger history).

2. Paste it into our browser JSON Flattener.

3. Compare the dot-notation keys in the output against what your workflow expects. Missing keys reveal where the payload differs from your assumption.

4. Fix your workflow expressions to handle the actual shape.

This takes 60 seconds instead of spinning up a new test run. Keep the flattener tab open while you build workflow expressions.

Debug Your Workflow Flatten Logic Fast

Paste your sample payload, see the flat keys, design your mappings from there.

Open Free JSON Flattener

Frequently Asked Questions

Does Power Automate have a flatten JSON action?

No native action. You either use Select + Compose to map fields manually, or call an Office Script or Azure Function that runs flatten logic. For one-off or debug work, flatten a sample in the browser first to see what paths exist.

How do I flatten a nested JSON array in n8n?

Split the array first with an Item Lists Split Out node, then apply a Function node with a flatten helper to each item. This gives you one flat output item per array element.

What does ADF flatten transformation actually do?

It specifically handles arrays — each array element becomes a separate row, with the parent object properties denormalized onto each row. For structural flattening (just dot-notation keys, no array expansion), use Derived Column with dot-path expressions instead.

Can I use the browser tool to design my workflow flatten logic?

Yes — this is its best low-code use case. Flatten a sample payload to see the output shape, then build your workflow mappings to produce that exact shape. Saves a lot of trial and error on failed runs.

Stephanie Ward
Stephanie Ward Diagram & Visual Documentation Writer

Stephanie spent eight years as a business analyst creating flowcharts and process diagrams for enterprise software teams.

More articles by Stephanie →
Launch Your Own Clothing Brand — No Inventory, No Risk