Cheat Sheets/Power Automate/union
Power Automate (WDL) function

unionPower Automate (WDL) function reference

Merge arrays, dropping duplicates.

Syntax

wdl
union(collection1, collection2, ...)

Examples

wdl
union(variables('a'), variables('b'))
Combined array
wdl
union(variables('existingIds'), createArray(triggerBody()?['NewId']))
The existing id list plus the new one, deduped
wdl
length(union(body('Get_items_A')?['value'], body('Get_items_B')?['value']))
Count of distinct combined rows

Common mistakes & gotchas

Related Workflow Definition Language functions

From Arrays & collections

Used in these tutorials

← Back to the Power Automate (WDL) cheat sheet