cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

Send one email to from a Sharepoint list containing multiple instances of a Person

Hi Community,

 

I have a Sharepoint List that is a log of issues, e.g. ID, Person, Issue Description, etc...

 

What I'm trying to achieve in Power Automate is to Get Items from the Sharepoint List, then create a HTML table, then email that list of issues to Person identified in the list. The problem I'm having is that if the Person appears multiple times in the list, duplicate emails are sent to them again (Apply to Each, because the item being called is within an Array).

 

What I'd like is for only one email to be sent to anyone in that list once, and this goes for any others Person who appears in that list multiple times too.

 

Any help is really appreciated.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Dual Super User III
Dual Super User III

The key here is to sort the list by person first and then process the list.  Inside each loop store the information, including the person its about you want to send out to the person.  Then at the top of the loop check to see if the person for this loop is the same as the one stored from the last loop.  If not, take the information you've been accumulating and send the email.  Then zero out the information and start collection new info on the new person.  When you finish processing everything send one last email for the last person in the list.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Hi @Pstork1 

 

Thanks for your reply. I'm pretty new to this, your solution is correct and it pointed me in the right direction to some other responses shows the steps required.

 

Shout outs to @RezaDorrani 

https://powerusers.microsoft.com/t5/Building-Power-Apps/Removed-duplicate-from-Delimiter-string/m-p/...

and 

@rchapman 

https://powerusers.microsoft.com/t5/Building-Power-Apps/Flow-How-to-remove-duplicate-email-addresses...

 

This is such a great community. Thanks all!

View solution in original post

2 REPLIES 2
Dual Super User III
Dual Super User III

The key here is to sort the list by person first and then process the list.  Inside each loop store the information, including the person its about you want to send out to the person.  Then at the top of the loop check to see if the person for this loop is the same as the one stored from the last loop.  If not, take the information you've been accumulating and send the email.  Then zero out the information and start collection new info on the new person.  When you finish processing everything send one last email for the last person in the list.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Hi @Pstork1 

 

Thanks for your reply. I'm pretty new to this, your solution is correct and it pointed me in the right direction to some other responses shows the steps required.

 

Shout outs to @RezaDorrani 

https://powerusers.microsoft.com/t5/Building-Power-Apps/Removed-duplicate-from-Delimiter-string/m-p/...

and 

@rchapman 

https://powerusers.microsoft.com/t5/Building-Power-Apps/Flow-How-to-remove-duplicate-email-addresses...

 

This is such a great community. Thanks all!

View solution in original post

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (5,538)