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 / Issue with sending one...
Power Automate
Unanswered

Issue with sending one email to multiple recipients with the same email address from excel sheet

(0) ShareShare
ReportReport
Posted on by

Hi,

I have a flow that works in the following way:

- It gets the list from excel

- Looks for the email addresses and groups the group clients column against the same email addresses and puts them in the email body

- Sends one email to the recipient that appears more than once on the list.

 

Everything works fine but if I edit the email body to pick up the name column, highlighted in green in the below screenshots- currently not picking up the name field, but if I add it, it modifies my flow and ends up sending multiple emails.

 

Figen_0-1668161687392.png

 

How can I sort this out please? I have the Table & Email as variable array

Figen_2-1668162056752.png

 

Figen_1-1668162005319.png

Figen_3-1668162148554.png

Any help is greatly appreciated.

 

Thanks

Figen

Categories:
I have the same question (0)
  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    @Figen  are you looking to send one email with multiple recipients in To?

  • Figen Profile Picture
    on at

    @annajhaveri no, separate emails to each individual, but trying to avoid sending multiple emails to the same person.

    Thank you

  • grantjenkins Profile Picture
    11,063 Moderator on at

    @Figen After you append all your email addresses into your Email variable you can add a Compose with the following expression to remove duplicate emails.

     

    join(variables('Email'),variables('Email'))

     

    Then use the Compose instead of the Email variable since the Compose will only include unique email addresses.

  • Figen Profile Picture
    on at

    @grantjenkins thank you but I already have this to remove duplicate emails. It only sends multiple emails when I include the name column to bring in the recipients' names in to the email body.

    I need to add a similar function to remove the multiples for Names but no matter what I tried it is just not working.

  • v-chengfen-msft Profile Picture
    on at

    Hi @Figen ,

    You could define a Name variable first, and then use [Set variable] to define the variable in Condition.

    Finally, set the Name variable to null at the end of the mailbox array loop.

    Here is a test for your reference:

    Here is excel :

    vchengfenmsft_7-1668415719876.png

     

    Here is flow:

     

    vchengfenmsft_0-1668414917071.png

    vchengfenmsft_1-1668414917116.png

    vchengfenmsft_4-1668415252814.png

    vchengfenmsft_3-1668414917137.png

    Here is result:

    vchengfenmsft_6-1668415689448.png

     

    Best Regards

    Cheng Feng

     

  • grantjenkins Profile Picture
    11,063 Moderator on at

    @Figen This is how I would go about achieving what you are after.

     

    I've got the same Excel Table/Data as you.

    grantjenkins_0-1668418476887.png

     

    Below is the full flow. I'll go into each of the actions.

    grantjenkins_1-1668418590429.png

     

    List rows present in a table retrieves all the data from the Excel Table.

    grantjenkins_2-1668418646570.png

     

    Select gets an array of objects consisting of just the Name and the Email address.

    grantjenkins_3-1668418700071.png

     

    Compose removes any duplicate objects from our Select so we have a unique set of Names/Emails to loop over. The expression is:

    union(body('Select'), body('Select'))

    grantjenkins_4-1668418791480.png

     

    Our Apply to each iterates over each of the unique objects.

    grantjenkins_5-1668418830715.png

     

    The Filter array will filter our items where the Name is equal to the current Name in our object we are iterating over. The expression used in the condition is:

    items('Apply_to_each')?['Name']

    grantjenkins_6-1668418945200.png

     

    We can then use Create HTML table retrieving the Group clients from the Filter array. The expression to get the Group clients is:

    item()?['Group clients']

    grantjenkins_7-1668419046358.png

     

    Finally, we can use Send an email with the Email and Name from the object we are currently iterating over and including the Output from the Create HTML table which will display the Group clients. The expressions used to get the Name and Email are:

    items('Apply_to_each')?['Email']
    
    items('Apply_to_each')?['Name']

    grantjenkins_8-1668419245796.png

     

    The final output/email would look like the following:

    grantjenkins_9-1668419446354.png

     

    Hopefully that all makes sense and is what you're after.

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 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard