Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

How to group multiple entries for a user into a single reminder email

(1) ShareShare
ReportReport
Posted on by 2
I have a SharePoint List that contains the dates of all our certificate/license renewals, all of which have a renewal date and an owner. I'm trying to build a flow that will check this list every day, find any renewal dates within the next 60 days and send a reminder email to the owner. I've build a Apply To Each loop that can do that, but the issue is it send multiple emails to the same person, as they are the owner of multiple certificates or licenses.
 
What I would like to do is build something that identifies all of the certificate or license renewals for that owner, group them together into an email and send it through as one email. The only way I can think to do it is to build a separate path in the flow for each Owner, and perform a check for them individually, but there are over 20 owners so it could take a while and I'm not sure it's the most efficient process.
 
Is there a different way to check the list, find all of the relevant certificate/license renewals and group them by the owner?
Categories:
  • Suggested answer
    tmcguire47 Profile Picture
    tmcguire47 2 on at
    How to group multiple entries for a user into a single reminder email
    Hi -- i think you will want to double-dip into the sharepoint list...
    First, pull the sharepoint list to get the list of renewals within the next 60 days...you could grab just the email addresses into an array...and then filter the array to remove duplicates.  You can use union() to remove duplicates...in powerautomate, union combines arrays and removes duplicates, so if you combine an array with itself, the output is an array of unique values.
     
    So, to do all that, you can use the Sharepoint "Get Items" with the filter on the renewal date...that gets you the items.
    Then, add a Data Operation -> Select
    and in the Select, just map the email address.
    Next, add a Data Operation -> Compose
    and, assuming your Select is named "Select" this should give you unique email addresses: union(body('Select'),body('Select'))
     
    Now, you can use an Apply to Each loop and put everything you had previously in your original Flow inside it, with the addition of including the email address as part of the filter when you select the Sharepoint items.
     
    Next, you can move your email action out of the original Apply to Each, and kindof out one level and in the place of the original step that sent emails, if you append the info you want to a variable, then each pass that used to result in an email being sent will now add content to your variable...
    Then, in your step to compose an email, grab the combined content of the variable.
     
    The result should be:
    1. get the list of unique email addresses where the owner has one or more expiring items
    2. use that in the filter to get the list of expiring items for each owner
    3. combine the expiring items into a list/text/variable
    4. compose 1 email per owner, and include the combined info in that one email.
  • AnitaE61 Profile Picture
    AnitaE61 10 on at
    How to group multiple entries for a user into a single reminder email
    Hi SteveD-NSSI
     
    The way I achieve this in my flows is as follows:
     
    I have a table saved to Sharepoint which has hundreds of rows and several email addresses,  I group those email addresses and send them as rows in a table to the owners via email 
     
     

    The Select - FD Email step points to the owners email from the source data
     
    The Compose - Group Emails action is a union function which points back to the Select - FD Email action
     
    union(body('Select_-_FD_Email'),body('Select_-_FD_Email'))
     
    I then create an Apply to Each action which points back to the Compose - Group Emails action
     
    The Filter Array action is as follows
     

     
    Hope this helps
  • AnitaE61 Profile Picture
    AnitaE61 10 on at
    How to group multiple entries for a user into a single reminder email
    Hi SteveD-NSSI
     
    The way I achieve this in my flows is as follows:
     
    I have a table saved to Sharepoint which has hundreds of rows and several email addresses,  I group those email addresses and send them as rows in a table to the owners via email 
     
     
    The Select - FD Email step points to the owners email from the source data
     
    The Compose - Group Emails action is a union function which points back to the Select - FD Email action
     
    union(body('Select_-_FD_Email'),body('Select_-_FD_Email'))
     
    I then create an Apply to Each action which points back to the Compose - Group Emails action
     
    The Filter Array action is as follows
     
     
    Hope this helps
  • AnitaE61 Profile Picture
    AnitaE61 10 on at
    How to group multiple entries for a user into a single reminder email
    Hi SteveD-NSSI
     
    The way I achieve this in my flows is as follows:
     
    I have a table saved to Sharepoint which has hundreds of rows and several email addresses,  I group those email addresses and send them as rows in a table to the owners via email 
     
     
    The Select - FD Email step points to the owners email from the source data
     
    The Compose - Group Emails action is a union function which points back to the Select - FD Email action
     
    union(body('Select_-_FD_Email'),body('Select_-_FD_Email'))
     
    I then create an Apply to Each action which points back to the Compose - Group Emails action
     
    The Filter Array action is as follows
     
     
    Hope this helps

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,567

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,907

Leaderboard