A2oz

How to Append an Array to Another Array in Power Automate?

Published in Power Automate 2 mins read

You can append an array to another array in Power Automate using the "Append to array variable" action. This action allows you to add the elements of one array to the end of another array.

Steps to Append an Array:

  1. Create two arrays: You'll need two arrays: the first array to which you want to append elements, and the second array containing the elements you want to add.
  2. Use "Append to array variable" action: Find the "Append to array variable" action in the "Control" category of your Power Automate flow.
  3. Select the target array: Choose the array variable where you want to append the elements.
  4. Select the source array: Choose the array variable containing the elements to be appended.
  5. Run the flow: Execute your Power Automate flow to append the second array to the first array.

Example:

Let's say you have two arrays:

  • Array1: ["Apple", "Banana"]
  • Array2: ["Orange", "Grape"]

To append Array2 to Array1, you would use the "Append to array variable" action, selecting Array1 as the target array and Array2 as the source array. The resulting Array1 would be: ["Apple", "Banana", "Orange", "Grape"].

Practical Insights:

  • Array types: The "Append to array variable" action works with arrays of any data type (string, number, object, etc.).
  • Modifying arrays: The "Append to array variable" action modifies the existing target array. If you need to keep the original array intact, create a new array variable and append to that.

Conclusion:

The "Append to array variable" action in Power Automate provides a simple and efficient way to combine multiple arrays. This action is useful for various tasks, such as building lists, collecting data from multiple sources, and processing complex data structures.

Related Articles