cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dennisb88
Super User
Super User

Send one e-mail for multiple list items

Hi all,

 

I've a question about how to create a flow that check all the items in a flow and send an e-mail to all the companies that are stored in the list.

 

For your information, I've a flow with multiple customers inside. For some customers, there are multiple line items, I need to merge the information into one e-mail. Every customer has an identical relation number, so that's a matching point in the list that can be used.

 

The list is created as follow:

 

2020-12-14 11_57_21-Window.png

 

Now I need to send every customer ONE (1) e-mail about the changes. Because it's possible that a customer have multiple line items, it's required that every customer get one e-mail with all the list items that's matched with his relation number.

 

Example e-mail:

 

Dear relation,

 

Whe will let you know that your pickup day(s) will be changed:

Your current pickup day for Contract A Monday will be changed to Saterday.

Your current pickup day for Contract B will be changed to Friday.

Etc.

 

How can I achieve this?

 

(The trigger is when I push a button).

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
v-litu-msft
Community Support
Community Support

Hi @dennisb88,

 

You could following these steps to do that:

First part, get all items in the list and store Email addresses into an array variable, then use union() function to remove repeat email addresses.

union(outputs('Compose'),outputs('Compose'))

Screenshot 2020-12-15 152605.jpg

 

Screenshot 2020-12-15 152626.jpg

 

Second part, initialize a string variable to store the Email body, Then use Apply to each action to loop the Email address in part 1, then use Get items with filter query:

Contacte_x002d_mailAddress eq '@{item()}'

Then append each line into the string variable, after all rows about current customer in it, send email and empty the string variable for next customer.

Screenshot 2020-12-15 152649.jpg

 

Screenshot 2020-12-15 152724.jpg

 

Screenshot 2020-12-15 152739.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-litu-msft
Community Support
Community Support

Hi @dennisb88,

 

You could following these steps to do that:

First part, get all items in the list and store Email addresses into an array variable, then use union() function to remove repeat email addresses.

union(outputs('Compose'),outputs('Compose'))

Screenshot 2020-12-15 152605.jpg

 

Screenshot 2020-12-15 152626.jpg

 

Second part, initialize a string variable to store the Email body, Then use Apply to each action to loop the Email address in part 1, then use Get items with filter query:

Contacte_x002d_mailAddress eq '@{item()}'

Then append each line into the string variable, after all rows about current customer in it, send email and empty the string variable for next customer.

Screenshot 2020-12-15 152649.jpg

 

Screenshot 2020-12-15 152724.jpg

 

Screenshot 2020-12-15 152739.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-litu-msft ,

 

Thank you, that's helping a lot.

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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (2,636)