I was working on a Power Automate project where I needed to create an array from SharePoint list items. The goal was to extract specific data from the SharePoint list.
In this tutorial, we will learn how to create an array from SharePoint list Items using Power Automate.
Create an Array From SharePoint List Items Using Power Automate
Imagine you have a SharePoint list named “Employee Directory” with the following columns:
- Employee Name (Person or Group)
- Department (Choice)
- Status (Choice: Active/Inactive)

I want to create an array of all active employee names from this list and use it in your Power Automate flow.
Now follow the below steps:
1. In the Power Automate, click the Instant Cloud flow, enter the Flow name, and choose the trigger flow (i.e., manually trigger a flow).

2. Add an Initialize variable action, provide a name, and select type as array:

3. Next, add the Get items action to retrieve all the sharepoint list items and provide the below parameters:
- Site Address: Select your SharePoint site address from the drop-down.
- List Name: Select the SharePoint list from the drop-down.

4. Then add Append to array variable action and provide the below parameter:
- Name: select the above array variable name.
- Value: provide the below values:
{
"Employee Name": "@{items('For_each')?['EmployeeName/DisplayName']}",
"Employee Email":"@{item()?['EmployeeName/Email']}",
"Job Title":"@{item()?['EmployeeName/JobTitle']}",
"Department": "@{item()?['Department/Value']}",
"Status": "@{item()?['Status/Value']}"
}Then, it will automatically add a For each loop.

5. Outside of the for each action, add a compose action and provide the above array variable in the Input parameters.

Now, click on save and run the flow manually. After the flow runs successfully, click the compose action to see the Output section. It displays the SharePoint list item values in an array format.

Create an Array from a SharePoint list of Items Based on Condition using Power Automate
In the example above, we see all the items in the array. However, if you prefer, you can filter the items based on a condition. Now, let’s see how to create an array from a SharePoint list where the status is “Inactive.”
Now follow the below steps:
Create an Instant Cloud flow with the “Manually trigger a flow” option. Then, add an “Initialize variable” action, provide a name for the variable, and set the type to “Array.”

Add the “Get items” action to retrieve all the SharePoint list items. Then, provide the Site Address and List Name. Expand the “Advanced options,” select the “Filter Query,” and enter the following filter condition.
Status eq 'Inactive'
Next, add Append to array variable action, provide the above array name, and provide the below value using dynamic content:
{
"Employee Name": "@{items('For_each')?['EmployeeName/DisplayName']}",
"Employee Email": "@{item()?['EmployeeName/Email']}",
"Job Title": "@{item()?['EmployeeName/JobTitle']}",
"Department": "@{item()?['Department/Value']}",
"Status": "@{item()?['Status/Value']}"
}Then, it will automatically add a For each loop.

Outside of the for each action, add a compose action and provide the above array variable in the Input parameters.

Now, click on save and run the flow manually. After the flow runs successfully, click the compose action to see the Output section. You can see only the inactive status.

Conclusion
In this tutorial, we learned how to create an array from SharePoint list items using Power Automate. I showed you how to retrieve data from a SharePoint list, initialize an array variable, and append specific data (like employee names, emails, job titles, departments, and statuses) to the array.
Additionally, we explored how to filter the list items based on a condition, such as retrieving only employees with an “Inactive” status.
Some more articles you may also like:
- Reverse an Array in Power Automate
- Attach Files to Planner Tasks Using Power Automate
- Initialize Array Variable in Power Automate
- Remove Item from Array using Power Automate
- Create an HTML Table from an Array in Power Automate

After working for more than 18 years in Microsoft technologies like SharePoint, Microsoft 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (12 times). I have also worked in companies like HP, TCS, KPIT, etc.