Skip to content

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.

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=> List
Variables.AddItemToList Item: 1 List: List NewList=> List
Variables.AddItemToList Item: 2 List: List NewList=> List
Variables.AddItemToList Item: 3 List: List NewList=> List
Variables.CreateNewList List=> List2
Variables.AddItemToList Item: 4 List: List2 NewList=> List2
Variables.AddItemToList Item: 5 List: List2 NewList=> List2
Variables.AddItemToList Item: 6 List: List2 NewList=> List2
Variables.CreateNewList List=> MultiList
Variables.AddItemToList Item: List List: MultiList NewList=> MultiList
Variables.AddItemToList Item: List2 List: MultiList NewList=> MultiList
  1. In “Search actions”, type “Create new list” and create a list for the multidimensional array. Create the lists that go inside it (List and List2 in the sample) the same way, and add items to them with “Add item to list”.

  2. 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.

  3. When you run the flow, the multidimensional array is stored in the variable you created.

The actions used here don’t throw any errors, so you don’t need to handle any.