cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nofe4r
New Member

Avoiding multiple emails to one user

Hey all,

 

I am a complete noob to PA so hopefully someone can put me right.

 

I currently have a Flow that emails info to people from a spreadhseet (the spreadheet has multiple lines for the same person(s) I found a solution that works for me here - Solved: Sending one email per person even with multiple en... - Power Platform Community (microsoft.... and it works great.

 

My problem now is that when I try and personalise the email by adding a name or something unique to the person by dragging dynamic content linking it to the Excel sheet, it sends multiple emails to the same person (one email per line). I cannot get my head around how to overcome this. Can anyone help? Thank you.

5 REPLIES 5
manuelstgomes
Super User II
Super User II

Hi @nofe4r 

 

When you're building the emails to send to the people you're using the union function. This will get an array and transform it into a string. So the Flow will only have one value to send.

 

When you try to personalize, you're going into the "array" to fetch a result. Since Flow doesn't know what element you want it wraps the email in an appy to each so that you can go over all results. Since the send email is inside the apply to each it will send multiple emails.

 

To solve this you need a similar strategy by converting all the values you want into a string that can be added to the email body as a string.

 

Can you use the "union"?

 

What are you trying to add so that we can figure out how to aggregate the values so that they are combined into only one string?

 

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

Hi Manuel, Thank you for taking time to reply.

 

So as an example table - 

image.png

Using the Flow as in the link I provided, each user gets one email with all the lines in table that refer to them, this is what I want. But when I add the name column to the email to personalise it, thats when they receive multiple emails per line. So in this case John would receive 3 emails (all with the same content), and Jane would recive 3 emails (all with the same content). Hopefully this explains it.

 

Thank you

Tourist
Helper I
Helper I

@nofe4r append all the email values in an array and compose the union of it and put that compose output in To

Thanks for the help. I decided to scrap my original solution and used this one instead - Solved: Mail merge excluding duplicate emails - Power Platform Community (microsoft.com)

 

I just repeated the same for all duplicated cells and works like a charm 🙂

manuelstgomes
Super User II
Super User II

HI @nofe4r 

 

I'm glad it worked.

 

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

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (40,221)