Multidimensional arrays
In Power Automate Desktop, a variable that can hold multiple values is called a “list”.
Tabular data retrieved from sources such as Excel is stored in a data table variable. On the other hand, if you want to build a multidimensional array (an array of arrays) from scratch with lists, you have to combine several actions.
This article explains how to create a multidimensional array (an array of arrays) by using list data.
Implement by copying and pasting
Section titled “Implement by copying and pasting”As a sample, here’s a scenario that creates a list containing other lists.
Copy the following code and paste it into the Power Automate Desktop flow designer to add the actions.
Variables.CreateNewList List=> ListVariables.AddItemToList Item: 1 List: List NewList=> ListVariables.AddItemToList Item: 2 List: List NewList=> ListVariables.AddItemToList Item: 3 List: List NewList=> ListVariables.CreateNewList List=> List2Variables.AddItemToList Item: 4 List: List2 NewList=> List2Variables.AddItemToList Item: 5 List: List2 NewList=> List2Variables.AddItemToList Item: 6 List: List2 NewList=> List2Variables.CreateNewList List=> MultiListVariables.AddItemToList Item: List List: MultiList NewList=> MultiListVariables.AddItemToList Item: List2 List: MultiList NewList=> MultiListImplement in Power Automate Desktop
Section titled “Implement in Power Automate Desktop”-
In “Search actions”, type “Create new list” and create a list for the multidimensional array. Create the lists that go inside it (
ListandList2in the sample) the same way, and add items to them with “Add item to list”. -
In “Search actions”, type “Add item to list” and set the following parameters.
Parameter Value Add item A list you’ve already created Into list The list you defined in step 1 Add this action once for each list you want to add.
-
When you run the flow, the multidimensional array is stored in the variable you created.
Possible errors
Section titled “Possible errors”The actions used here don’t throw any errors, so you don’t need to handle any.