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
Super User

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 II
Helper II

@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
Super User

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
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

AI Builder AMA June 7th carousel (up on May 25th, take down June 8th) (1).png

'Ask Microsoft Anything' about AI Builder!

The AI Builder team invite you to ask questions and provide helpful answers at our next AMA.

Users online (1,642)