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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Group same items from ...
Power Automate
Suggested Answer

Group same items from SharePoint GetItems

(1) ShareShare
ReportReport
Posted on by 402
We have a process that runs the first of each month and gets items from a SharePoint library. The items are documents that are filtered by a property called ReviewMonth and does properly return the next month's documents up for review. So, today being August 1, returned documents that are marked for review for September.  In this list is another property (a person field) called Owner.  The process iterates through each item, gets the Owner/Email and does append the value to a string variable that is used to send email.  What it does not do is to group the same email, or only count it once. This is the question and the ask,
 
Here is a simple example:
Returned list
Document 1, Joe Smith, jsmith@abcd.com
Document 2, Joan Crawford, jcrawford@abcd.com
Document 3, Joe Smith, jsmith@abcd.com
Document 4, Bill Manning, bmanning@abcd.com
Document 5, Joan Crawford, jcrawford@abcd.com
Document 6, Joe Smith, jsmith@abcd.com
 
What is being returned
jsmith@abcd.com; jcrawford@abcd.com; jsmith@abcd.com; bmanning@abcd.com; jcrawford@abcd.com; jsmith@abcd.com
 
What needs to be returned
jsmith@abcd.com; jcrawford@abcd.com; bmanning@abcd.com
 
Thanks for any help and information.
Categories:
I have the same question (0)
  • Suggested answer
    Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at
    Hi, 
     
    So once you get the details of documents to be reviewed, now use select action and then use email id of person in map section. After that use union operation and join with delimiter ;
     
    see below for better idea
     
    assume this is document librray with reviewmonth and owner column
     
    Now after Get files where the output will be filtered list of documents whose review document is September considering current month,
     
    Use Select action as shown below
     
    This will help to get list of owner email ids in array format.
     
    Now we need to get distinct email ids from that array and join it by ; delimiter so to use in send email action, for that i have written an expression in send email action as shown below which does the same 
     
    Expression used- 
    join(union(body('Select'),body('Select')),';')
     
    Thus it helps to avoid duplication in emails

    If you are using sharepoint list, this logic would also works !
     
    Hope it helps !
    Thanks & Regards,
    Nived N 
    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs
     Found my answer helpful? Please consider marking it as the solution!
     Your appreciation keeps me motivated. Thank you!

     
     
  • Suggested answer
    mathiaskjeldsen Profile Picture
    224 on at
    Hey 
     
    An alternative solution would be to implement a variable - call it UniqueEmails. Once that's set up, do an iteration through each entries in the list. Then add IF statement that stipulates mail should only be added to variable UniqueEmails if mail doesn't already exist in the variable. Else add mail to the list.
     
    Hope this makes sense.
     
    Best regards
    Mathias Kjeldsen 
     
    ---
    If this has helped solve your problem, please mark it as an helpful answer.
     
    Connect with me on social platforms by using the links below.
    YouTube: https://www.youtube.com/@matkjeldsen 
    LinkedIn: https://www.linkedin.com/in/mathiaskjeldsen/

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard