I have a Flow that sends an Email to people in a contact list, but I sometimes get duplicate values in my array.
I dont want to send multiple messages to the same Email, so i need to remove the duplicated values.
Any idea how can i do that?
This is a great post and helped a lot thank you. I want to add on that question.
My scenario is this. I have to Tables (Arrays) I want to compare.
But first I need to filter the Table BC to only have distinct Account numbers, the catch is I want the Account number (in this case CPA004) to retain the entry with the highest last entry number (4002), and discard the other CPA004 entries.
A faster way to remove duplicates is to union the input array with an empty array. This saves a lot of time with larger sets.
Initialize an empty array using Compose and use another Compose to union the input array with the empty array.
Union with empty array to get unique values.
Thabnk you very much, this was very usefull!
Thank you very much for the detailed explanation.
This worked as expected.
Hello Team,
This is extremely easy to implement, let me guide you.
First see my outputs and final results-
I had an array that had values 1,2,2,3,2 and needed to remove duplicates.
I used the Union() expression and got the final result 1,2,3.
How to do this, first load your array outputs in COMPOSE. My Array outputs are currently residing in array variable called ARRAY
Then Create another COMPOSE and use the following expression -
union(outputs('Compose'),variables('Array'))
Here COMPOSE is the action where the Array was loaded and Array is the name of the Array variable. Please refer the 1st compose action we create you will understand it.
This is all you need to do.
Once this is done, create another COMPOSE and load the outputs of Compose created earlier (the one where we put the expression) to get unique values returned.
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
@Anonymous
Let's assume you have your array stored in a variable called 'myArray'. In order to remove duplicates all you need to do is to create a 'Compose' action block, and assign it the following WDL expression
union(variables('myArray'),variables('myArray'))
You can also assign the expression to a new variable, if you prefer it instead of the Compose approach
Suerte!
Hi!
I would suggest to use union() WDL function
Give me some minutes to write a clear example
stampcoin
97
Michael E. Gernaey
70
Super User 2025 Season 1
David_MA
48
Super User 2025 Season 1