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

Sending an email to email addresses from more than one list

Hi, guys! I'm a beginner in Power Automate. I have a simple flow  I created that sends an email to a list of emails stored inside a list. It works fine.

Here is a photo

email1.JPG

 

 

But now, this email also needs to be sent to a list of emails from another list. I tried creating the below but it had an error. The 'Apply to each 2' was automatically generated when I entered in the 2nd 'Title' in the recipients text box.

 

email2.JPG

 

email3.JPG

 

How to resolve the error? I would really appreciate if screenshots are given for sample.

6 REPLIES 6
ccc333ab
Solution Sage
Solution Sage

The error message is because you aren't using a valid email address. Assuming "Title" contains an email address, you'll need to use a semi-colon (;) betwen your two "Title" fields. 

 

However, what are you trying to actually do. Right now you'll loop through every row in your List 1, and then for each of these you'll then loop thorugh each row in List 2, sending an email to every combination of each list. 

 

I.e., 

 

List 1: Homer, Bart, Milhouse

List 2: Lisa, Marge, Maggie

 

THis will loop thorugh and send an email to: 

Homer/Lisa, Homer/Marge, Homer/Maggie, Bart/Lisa, Bart/Marge, Bart/Maggie, Milhouse/Lisa, Milhouse/Marge, Milhouse/Maggie 

 

If that is what you are trying to do then great!!!

Hi @ccc333ab ! Noted on the semi-colon!

 

As you illustrated, the looping thing (Homer/Lisa, Homer/Marge, Homer/Maggie, Bart/Lisa, Bart/Marge, Bart/Maggie, Milhouse/Lisa, Milhouse/Marge, Milhouse/Maggie ) is not my intention.

 

Based on your scenario, I would like the email to be sent to Homer, Bart, Milhouse, Lisa, Marge, Maggie. How do I achieve this? (Nice examples, by the way 😁 )

ccc333ab
Solution Sage
Solution Sage

I guess it depends on how complicated you want to get, or if there are other things you are trying to do with this flow. You could, for example, is just run two separate loops for each list (i.e., have two ""Send an email" actions for each list).  

 

If you don't want to have two separate email actions do that, you could do something like this: 

 

1. Get the lists and just select out the Title from each list (since it holds an email address, I am mapping it to a column called "EmailAddress"). 

ccc333ab_0-1628695046605.png

 

2. Now union those two into a single column using a "union" expression. 

ccc333ab_1-1628695127846.png

3. Now loop thorough each of these items you unioned together, and send an email to them. 

ccc333ab_2-1628695447899.png

 

 

Hi @ccc333ab !  I got stuck in step 3. What is the full function you used inside 'Send an Email' ? Thank you

ccc333ab
Solution Sage
Solution Sage

Sorry, I should have pointed out I listed the expression in the note box (above the TO: line). But here it is in text for you: 

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

 

Also, make sure you are typing this as an expression, not just in the To: Line

ccc333ab_0-1628779781560.png

 

JeffGimo
Resolver II
Resolver II

Here's a suggestion.
1. Get the Emails from SharePoint

2. Store the emails in a variable separated by semicolon ; 

3. Send email to variable from #2.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

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.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,814)