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 / Send one email to list...
Power Automate
Unanswered

Send one email to list of multiple email addresses

(0) ShareShare
ReportReport
Posted on by

I am working with a SharePoint list which contains multiple lines of data. Within the data is email addresses where the same person can be included more than once.

 

What I want to do is send an email to the email recipients but if the email recipient is listed more than once it should only send one email. 

 

I am starting with 'manual trigger' to start the flow - 'get items' referring to my SharePoint list - when I add 'send an email' it send the email per each item on the list so the one email address can receive 100's of emails.

 

How do I change the flow so it is only sending one email to each recipient?  

Categories:
I have the same question (0)
  • Verified answer
    Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @Anonymous,

     

    I think this would be possible if you use a union function to get the distinct values.

     

    Below is an example how you could achieve this.

     

    1. Add an initialize variable of type array

    emailaddressarray.png

    2. Append the email address values to that array. In my example I am using value output from a Get Items action.

     

    I am using a SharePoint list column is called PeopleTest (type Person or Group) and I am using the Email field of an item.

    appendemailaddresses.png

    3. Add an compose action with the following expression. This is the union to get the distinct values.

    union(variables('UniqueEmailAddressesArray'), variables('UniqueEmailAddressesArray'))

    unioncompose.png

    4. Add a parse json action to parse the output

    {
     "type": "array",
     "items": {
     "type": "string"
     }
    }

    parsejsonarray.png

    5. Use an send an email action inside of an apply to each loop to send the individual emails

    sendemail.png

  • Community Power Platform Member Profile Picture
    on at

    My flow is erroring at the first apply to each branch with the following error message...

     

    The execution of template action 'Apply_to_each_3' failed: the result of the evaluation of 'foreach' expression '@items('Apply_to_each')?['AssignedTo2']' is of type 'Object'. The result must be a valid array.

  • Community Power Platform Member Profile Picture
    on at

    Are you able to post a full screenshot of all your flow steps @Expiscornovus I'm trying to work out what is causing the error. 

  • Community Power Platform Member Profile Picture
    on at

    @Expiscornovus can you spot the error? 

     

    Basic_User007_0-1610460848840.png

     

  • Verified answer
    Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @Anonymous,

     

    In my example I was using a person column which allows multiple selections, which gives back an array as the result. How is your column in the list setup? Are you able to change that to allow multiple selections?

     

     

    allowmultipleselections_column.png

  • Community Power Platform Member Profile Picture
    on at

    In your screenshot it looks like you are using a double apply to each from value - people test & as per my screenshot below. Once I removed this I got it all working perfectly. 

     

    I have been able to use the same steps & formula to compose month field in email too. 

     

    Thank you so much for helping me out on this. Can see these steps will be useful in a lot of other flows to come 🙂 Thanks again!!! ***** 

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

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard