Power Automate (WDL) function
union — Power 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
- union() accepts more than two arrays and dedupes across all of them, but the order of items in the result is not guaranteed to match input order.
- For arrays of objects, "duplicate" means deep equality of the whole object — two records with the same Id but a different Modified timestamp are treated as distinct and both kept.
Related Workflow Definition Language functions
From Arrays & collections