Power AutomatePower Automate

Mastering Union, Except, and Intersect in Power Automate: A Simple Guide

By Ynias Bensch, Power Platform consultant

Combine, filter and compare arrays in Power Automate with the union, except and intersect functions, explained with simple examples.

When working with data in Power Automate, you often need to combine, filter, or compare lists dynamically. The union, except, and intersect functions help you achieve that efficiently. Let’s break down how each works with basic examples.

1. Union: Merging Two Lists

The union function combines two arrays and removes duplicates. It’s useful when you need to merge data from different sources into one list.

Example: Merging Two Lists of Names

Imagine you have two lists:

  • List A: ["Alice", "Bob", "Charlie"]
  • List B: ["Charlie", "David", "Emma"]

Using the union function:

Power Automate
union(
["Alice", "Bob", "Charlie"],
["Charlie", "David", "Emma"]

)

Or you can work with variables. Initialize and set the variables.union(varListA, VarListB)

Output:

["Alice", "Bob", "Charlie", "David", "Emma"]

👉 Duplicates are removed automatically!

2. Except: Finding Differences Between Lists

The except function returns values from the first list that don’t exist in the second list.

Example: Finding Unique Names in List A

Using the same lists:

Power Automate
except(

  ["Alice", "Bob", "Charlie"],

  ["Charlie", "David", "Emma"]

)

Or except(varListA, VarListB)

Output:

["Alice", "Bob"]

👉 Only names from List A that are NOT in List B appear.

3. Intersect: Finding Common Values

The intersect function returns only the values that exist in both lists.

Example: Finding Common Names

Power Automate
intersect(

  ["Alice", "Bob", "Charlie"],

  ["Charlie", "David", "Emma"]

)

Or intersect(varListA, VarListB)

Output:

["Charlie"]

👉 This helps when you need to find matching records in two datasets.

Published