union function. Collection.(Power Automate Cloud flows)

Japanese version.

This function merges two or more arrays to create a new array.

If the arrays contain the same elements, they are deduplicated to form a single item.

Spec

union('<collection1>','<collection2>' ~ '<collectionN>')
ArgumentDefaultDescription
collectionNRequired fieldArray of 2 or more.

How to use

In many cases, it is used to initialize or set variables of type "Array".

Clicking on union in the "Expression" tab sets the function name and () in the formula field.

Arguments are two or more arrays.

When dynamic content or variables are used in expressions, special specifications are required.

(How to get dynamic content with expressions.)

If you see something like the following, the setup is complete.

You can change the contents of the function by clicking on the purple icon.

In this case, three array variables are provided as an example.

Elements in red are duplicates and will become one item after integration.

VariableContents
ary1[100,200,300,400,500]
ary2[100,600]
ary3[0,300,700]

If the expression is "union(variables('array variable 1'),variables('array variable 2'),variables('array variable 3'))", the result is [100,200,300,400,500,600,0,700].

---

Links

Collection Functions(Power Automate Cloud flows)