Power Automate has a function that we can use to remove duplicate values and return a distinct or unique set of values: Union. For example, using the Union function [1] we can remove duplicate email addresses or names from a set or collection of data. [2]
The following Excel table contains multiple duplicate email addresses in the AssignedEmail column. We can write a flow to select just the AssignedEmail values and then use the Union function to remove duplicate email addresses:

(1) We first use the Select action to select only the values in the AssignedEmail column. Note that the Select action needs to be in Text Mode as illustrated below:

The runtime output of the Select action is shown below. The Select action will select all values from the AssignedEmail column:

(2) We next use the Union function to remove duplicate email addresses. This is the expression used for the Union function:

union(body('Select'), body('Select'))
This is the runtime output of the Union function. See how all the duplicate values have now been removed:

We are now left with an array of unique email addresses – exactly what we wanted!

Here is a demo flow using the unique set if email addresses:


Hope this helps.
Notes
- The Union Function: “Return a collection that has all the items from the specified collections. To appear in the result, an item can appear in any collection passed to this function. If one or more items have the same name, the last item with that name appears in the result.”
- Union of two sets: Sets cannot have duplicate elements, so the union of the sets {1, 2, 3} and {2, 3, 4} is {1, 2, 3, 4}. https://en.wikipedia.org/wiki/Union_(set_theory).
Leave a Reply