Power Automate Create an Array from JSON Objects [Step By Step]

If you’ve been working with Power Automate for a while, you’ve almost certainly run into a situation where you get a chunk of JSON back from an API or a connector — and you need to pull specific fields out of it and store them as an array for downstream processing.

That’s exactly what this tutorial covers. I’ll show you the most reliable way to build this flow using Parse JSON + Apply to Each + Append to Array Variable, and then I’ll show you a faster single-action alternative using the Select action that most people don’t know about.

I’ll also cover the most common errors that cause this to break, so you don’t spend an hour debugging something that has a simple fix.

What You’ll Need

Before we start, make sure you have:

  • Access to Power Automate (Microsoft 365 or Power Platform license)
  • Basic familiarity with creating a cloud flow
  • A JSON object or API response you want to work with

Understanding the Goal

Here’s what we’re working with. Imagine you receive this JSON payload maybe from an HTTP call, a SharePoint REST API response, or a Power Apps form submission:

{
"Customers": [
{ "Name": "Richard", "CustomerCode": "58244", "CustomerLocation": "France", "ContactNumber": 7894561230 },
{ "Name": "Noah", "CustomerCode": "14789", "CustomerLocation": "Mexico", "ContactNumber": 8456789620 },
{ "Name": "Jordan", "CustomerCode": "21456", "CustomerLocation": "Germany", "ContactNumber": 7584963210 },
{ "Name": "Rufus", "CustomerCode": "25896", "CustomerLocation": "Canada", "ContactNumber": 8457962130 },
{ "Name": "Rachel", "CustomerCode": "19835", "CustomerLocation": "USA", "ContactNumber": 8302165479 }
]
}

You don’t need all of that data. You only need the NameCustomerCode, and CustomerLocation fields. The goal is to end up with a clean array containing just those three fields for each customer ready to pass to the next step in your flow.

Create an Array from JSON Objects in Power Automate

Here, I will show you how to create an array from the json schema in Power Automate.

Method 1: Power Automate Parse JSON + Apply to Each (Most Common Approach)

This is the go-to method when you need to process each item individually as you build the array — for example, if you want to add a calculated field, apply a condition, or transform a value during the loop.

Step 1 — Create a New Flow

Go to Power Automate → Create → Instant Cloud Flow. Give your flow a name like “Create Array from JSON”, select Manually trigger a flow as the trigger, and click Create.

I’m using a manual trigger here to keep things simple. In a real scenario, your trigger might be an HTTP request, a SharePoint item being created, or a scheduled recurrence — the steps after the trigger are the same.

Step 2 — Initialize an Array Variable

Click + New step, search for Initialize variable, and add it.

Configure it like this:

  • Name: CustomerDetails
  • Type: Array
  • Value: Leave blank
Array & Object in Power Automate

It’s important to initialize the array variable before your loop. If you skip this step and try to append to an uninitialized variable inside the Apply to Each, the flow will fail with a confusing error.

Step 3 — Add a Compose Action for Your JSON

Click + New step, search for Compose, and add it.

Paste your full JSON object into the Inputs field. In a real flow, this would be a dynamic value — such as body(‘HTTP’) or triggerBody() — rather than a hardcoded JSON object. The Compose action here just gives us something to work with for demonstration.

Convert An Object To An Array in Power Automate

Step 4 — Parse the JSON

Click + New step, search for Parse JSON, and add it.

  • In the Content field, select the Outputs dynamic content from your Compose action.
  • In the Schema field, click Generate from sample.
  • Paste your JSON object into the sample window and click Done.
Create An Array From JSON Objects Using Power Automate

Power Automate will automatically generate the JSON schema for you. This schema is what tells the flow how to interpret the structure of your data and makes your fields available as dynamic content in the next steps.

Tip: If your JSON sometimes has optional fields that aren’t always present, go into the generated schema and remove those field names from the "required": [] array. This prevents the flow from failing when a field is missing.

Step 5 — Loop Through Items with Apply to Each

Click + New step, search for Apply to each, and add it.

In the Select an output from previous steps field, select Customers from the Parse JSON dynamic content. This tells the loop to iterate over each customer object in the array.

Inside the loop:

  1. Click Add an action, search for Append to array variable, and add it.
  2. In the Name dropdown, select your CustomerDetails variable.
  3. In the Value field, build the object you want to append. I usually do this as a small JSON expression like:
{
"Name": @{items('Apply_to_each')?['Name']},
"CustomerCode": @{items('Apply_to_each')?['CustomerCode']},
"CustomerLocation": @{items('Apply_to_each')?['CustomerLocation']}
}

You can also just select the dynamic content fields from the Parse JSON outputs — Power Automate will use the same expressions underneath.

Convert JSON (Object) to Array Power automate

Step 6 — Check the Output

After the Apply to Each, add a Compose action and pass the CustomerDetails variable into the Inputs field. This lets you inspect the final array output when you run the flow.

Step 7 — Save and Run

Click Save, then click Test → Manually → Test. Once the flow runs successfully, click on the Compose action at the bottom to see your output.

You should see a clean array with only the three fields you selected:

[
{ "Name": "Richard", "CustomerCode": "58244", "CustomerLocation": "France" },
{ "Name": "Noah", "CustomerCode": "14789", "CustomerLocation": "Mexico" },
{ "Name": "Jordan", "CustomerCode": "21456", "CustomerLocation": "Germany" },
{ "Name": "Rufus", "CustomerCode": "25896", "CustomerLocation": "Canada" },
{ "Name": "Rachel", "CustomerCode": "19835", "CustomerLocation": "USA" }
]
Extract json as Array in Power Automate

That’s the full Method 1 flow done.

Method 2: The Select Action in Power Automate (Faster, No Loop Needed)

Here’s something I wish I’d known earlier — you don’t always need Apply to Each to create an array from a JSON object. The Select data operation can do this in a single step and is significantly faster, especially when dealing with large datasets.

Use this method when you just need to reshape the data (pick specific fields) without performing any action on each individual item.

How It Works

After your Parse JSON step, instead of adding Apply to Each:

  1. Click + New step, search for Select, and add it.
  2. In the From field, select Customers from Parse JSON dynamic content.
  3. In the Map section, turn on Switch to text input mode (the small icon in the top-right of the Map field).
  4. Enter your field mappings like this:
{
"Name": @{item()?['Name']},
"CustomerCode": @{item()?['CustomerCode']},
"CustomerLocation": @{item()?['CustomerLocation']}
}
How to turn array of objects into a single object in Power Automate

The Select action returns a new array with only the fields you mapped. No loop, no variable, no Append action needed — one step and you’re done.

When to Use Select vs. Apply to Each

ScenarioBest Action
Just need specific fields from a JSON arraySelect
Need to send an email or perform an action per itemApply to Each
Need to filter items based on a conditionFilter Array → then Select or Apply to Each
Need to add a calculated/transformed fieldApply to Each with Compose inside
Working with a large dataset (performance matters)Select (more efficient)

3 Real-World Scenarios Where You’d Use This

These aren’t contrived examples — these are the kinds of requests I see regularly:

1. Extracting data from a SharePoint REST API response
When you call the SharePoint REST API using an HTTP action, the response comes back as a JSON object with a value array. You’d use Parse JSON on the body, then Select to pull only the columns you need — like TitleID, and Email — before passing them to another system.

2. Processing a Microsoft Graph API response
If you’re calling the Graph API to get a list of users or groups, the response is a JSON object with a value array of user objects. Each user object has 20+ fields. Use Select to extract only displayNamemail, and id for downstream steps.

3. Handling JSON sent from a Power Apps form
When Power Apps sends data to a flow via the trigger body, it often comes as a JSON string. Use Parse JSON to convert it to structured data, then create an array of the form submissions to write to a SharePoint list or send to an external API.

Why Your Array Might Come Back Empty or Broken (And How to Fix It)

This is the section I wish every tutorial included. Here are the four most common reasons this flow breaks:

1. Parse JSON schema mismatch
This is the #1 cause of failures. If your live JSON data has a different structure than the sample you used to generate the schema — maybe a field is sometimes null, or a property name has a typo — the Parse JSON step will fail or produce empty outputs.

Fix: Open the Parse JSON action, go to the schema, and remove optional fields from the “required”: [] array. For fields that might be null, change their type to an array like [“string”, “null”].

2. Array variable not initialized before the loop
If you try to use Append to Array Variable inside Apply to Each without first initializing the variable outside the loop, the flow will error out.

Fix: Always put your Initialize Variable step before Apply to Each, not inside it.

3. The “From” field in Select or Apply to Each is getting an Object instead of an Array
This is a common one. Your JSON has a wrapper object ({ "Customers": [...] }) and you’re accidentally passing the entire body instead of the Customers array into the loop.

Fix: In the Apply to Each or Select “From” field, make sure you’re selecting the Customers dynamic content from Parse JSON — not the full body or outputs of the Compose/HTTP action. The expression should look like body('Parse_JSON')?['Customers'].

4. Schema generated from a partial sample
If you generated the schema from a JSON sample that was missing some fields, those fields won’t appear as dynamic content options. You might think the data isn’t there when it actually is.

Fix: Go back to Parse JSON, click Generate from sample, and use a complete JSON example that includes every possible field — even optional ones. Or use an online tool like jsonschema.net to generate a more complete schema manually.

Key Expressions Reference

These are the expressions you’ll use most often when working with JSON arrays in Power Automate. Bookmark this.

ExpressionWhat It Does
body('Parse_JSON')?['Customers']Gets the Customers array from Parse JSON output
items('Apply_to_each')?['Name']Gets the Name field of the current item in the loop
item()?['Name']Gets the Name field inside a Select action
outputs('Compose')Gets the full output of a Compose action
variables('CustomerDetails')References the value of your array variable
length(variables('CustomerDetails'))Returns the count of items in your array

Also, you may like:

Frequently Asked Questions

Can I create an array from a nested JSON object in Power Automate?

Yes. If your JSON has nested objects (like a customer object that contains an address object), you can access nested fields in your expressions using chained ?[] notation. For example: items(‘Apply_to_each’)?[‘Address’]?[‘City’]. Just make sure your Parse JSON schema reflects the nested structure.

What’s the difference between Parse JSON and the Select action?

Parse JSON converts a raw JSON string into structured, typed data so Power Automate understands its shape and makes the fields available as dynamic content. The Select action reshapes an existing array by mapping specific fields. You typically use both together — Parse JSON first, then Select to filter the fields you need.

Can I create an array from JSON without using Apply to Each?

Yes — use the Select data operation (Method 2 above). It processes the entire array in one step without a loop, which is cleaner and faster for simple field extraction.

How do I create an array from a SharePoint REST API JSON response in Power Automate?

Use an HTTP action to call the SharePoint REST endpoint, then add a Parse JSON action on the response body. Use the value array (which is how SharePoint REST API wraps list items) as the input to your Select or Apply to Each action.

What happens if my JSON array is empty?

If the array is empty, Apply to Each simply won’t execute — no error, just zero iterations. The Select action will return an empty array []. You can add a Condition after your flow to check length(variables(‘CustomerDetails’)) and handle the empty case gracefully.

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…