Convert SharePoint List or Excel Columns to a Single-Dimensional Array Using Power Automate
I couldn’t quickly find a method to convert a table (object array) retrieved from SPO (SharePoint Online) or Excel into a single-dimensional array, so here’s a memo.
For example, imagine you have a SPO list like this. Let’s say you want to extract only the “DisplayName” values from the “user” column and turn them into a one-dimensional array. Here’s how you can achieve this.
Create a One-Dimensional Array Using the “Select” Action
After retrieving the list items using an action to fetch multiple items, input the “value” field obtained from the list into the “From” field of the “Select” action. Next, click on the right-hand icon in the “Map” field.
Once the “Map” field becomes a single input box, simply enter the value you want to convert into an array (in this case, the “DisplayName”).
As a result, the output will be a one-dimensional array containing only the values from the specified column.
Distinct (Removing Duplicates Made Easy)
By converting data into a one-dimensional array, it becomes much easier to remove duplicates while focusing only on the specified column. You can use the `union` function for duplicate removal, as shown below:
This enables duplicate removal for “DisplayName” values in the user column, as demonstrated:
If you apply the `union` function directly to the SPO output:
Duplicate removal will include other columns (e.g., registration dates), which means it won’t ensure duplicates are removed based solely on user names.
※If you’re working in an environment where Dataverse is available, you can also use the Distinct function in Power Apps.