web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Filter array duplicate...
Power Automate
Answered

Filter array duplicates and add results to email

(0) ShareShare
ReportReport
Posted on by 566
Hello,
I have on my filter array some duplicates items.
Example items:
 
Portugal
France
Portugal
Spain
France
France
Spain
 
What i need to do is to filter and send the results of my fiter to my email based on these conditions below:
 
First filter array:
Portugal
Portugal
Then send an E-mail with these 2 Portugal Items
 
Next filter array:
France
France
France
Then send an E-mail with these 3 France Items
 
Next filter array:
Spain
Spain
Then send an E-mail with these 2 Spain Items
 
Some countries of my array will be added or removed lated , So my array will not have the same identical countries and duplicates.
 
Could you help me to create a filter array based on these conditions above?
 
Categories:
I have the same question (0)
  • Verified answer
    VictorIvanidze Profile Picture
    13,079 on at
    Just use union() function after filtering.
  • Suggested answer
    rzaneti Profile Picture
    4,483 Super User 2026 Season 1 on at
     
    Based on your description, I'm assuming that your array items are dynamically populated (items are added/removed later)? If this is the case, something that could work is a process like this:
    1- Identify all unique elements from the array, storing it into a dedicated array variable (it's value would be ["Portugal", "Spain", "France"])
    2- Iterate this array of unique elements with an Apply to each, and inside this loop, allocate a Filter array to filter all elements from your original array that match the currently iterated unique value. E.g. for the first loop iteration, you will filter the original array by Portugal, for the second Spain, and so on.
    3- The email step will depend on the type of information that you are extracting from this filtered array. I would need more information about what does this array contain o provide you a more detailed recommendation.
     
    Anyway, you can check these 2 blogs, which contain step-by-step guides on (1) how to get unique values from arrays and (2) how to group SharePoint Records by an individual column in PA. Although this second article explores the records coming from a SharePoint List, you can make a few changes to fits it to your needs - by the way, the example used there is to send the grouped records via email, so it can maybe help with your 3rd step as well :)
     
    - How to filter unique values from arrays in Power Automate? - https://digitalmill.net/2024/09/27/how-to-remove-duplicates-from-arrays-in-power-automate/
    - How to group SharePoint List records by column in Power Automate - https://digitalmill.net/2024/10/21/how-to-group-sharepoint-list-records-by-column-in-power-automate/
     
    Let me know if it works for you or if you need any additional help!
     
    If this solved your issue, please mark it as Accepted Answer.
    👍 If it helped, feel free to give it a like!

    🌐 Explore more Power Platform content on my Website or on my ▶️ YouTube
    💼 Find me on LinkedIn
  • Suggested answer
    Sormick Profile Picture
    566 on at
    Thank you! 
     
    With the union function which filters only unique values, i Created a Compose element with a loop to filter each of these unique values, then added another loop which filters all my values (unique or not) with a compose element.
    Finally i added this condition (if the 1st compose value (Unique values) is equal to my second compose value
    (all my values of my sharepoint list), then i add these duplicate values to new compose action and send the results to my email.
    That's all!
     
    Thank you for your support!
     
     
  • VictorIvanidze Profile Picture
    13,079 on at
    Hi ,,
    great. Could you mark my post as answer?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 607

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard