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

Multiple list items in one mail, but one mail per person

Hi all,

 

I'm trying to build a flow that sends recurring reminders to people of open list items. So, what it needs to do is:

 

  • Filter items in a list to open items
  • Send 1 mail with all items that have been assigned to person A and 1 mail with items that have been assigned to person B to these respective persons.

What I've managed to build is a flow that filters and sends only 1 mail, but the mail is send to everybody that appears in the 'assigned to' column. So basically everybody that has a list item assigned to them receives a list with all open list items, also the ones that are assigned to other people.

 

This is what I've done:

 

1.PNG2.png

 

3.PNG4.PNG

 

Thanks in advance for any help!

 

Merel

 

 

 

 

 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support
Community Support

Hi @Merel ,

 

Do you want to send emails to people with items assigned to them separately?

 

Please check if the following configuration will be a reference for you.

 

Initialize an Array variable named as Test.

 

Get items from the list using Filter Query Status eq ‘Approve’.

 

Add Apply to each, select Value from Get items, within the apply to each loop add action Append to array variable, select dynamic content Assigned Email for the Value field.

 

Add Compose action with the following function:

union(variables('test'),variables('test'))

 

Add Apply to each to, select output from the Compose output.

 

Within the loop, add action Filter array, select Value from Get items action, set its condition to:

Assigned Email is equal to Current Item (of Apply to each 2)

 

Add action Create HTML table, select Body from Filter array. Here I customize Title and assigned field using the following functions:

 

Title: item()?['Title']

Assigned: item()?['Assigned']?['Email']

 

Add action Send an email. Select HTML output for the body field, and enable Yes for the Is HTML field.

1.PNG2.PNG3.PNG

 

Best regards,

Mabel  

 

Community Support Team _ Mabel Mao
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

Hi @Merel ,

 

In the action Create HTML table, you should select Body from Filter array but not select Value from the action Get items.

 

Please check the screenshot I provided in my previous post and try again with it.

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
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

6 REPLIES 6
Community Support
Community Support

Hi @Merel ,

 

Do you want to send emails to people with items assigned to them separately?

 

Please check if the following configuration will be a reference for you.

 

Initialize an Array variable named as Test.

 

Get items from the list using Filter Query Status eq ‘Approve’.

 

Add Apply to each, select Value from Get items, within the apply to each loop add action Append to array variable, select dynamic content Assigned Email for the Value field.

 

Add Compose action with the following function:

union(variables('test'),variables('test'))

 

Add Apply to each to, select output from the Compose output.

 

Within the loop, add action Filter array, select Value from Get items action, set its condition to:

Assigned Email is equal to Current Item (of Apply to each 2)

 

Add action Create HTML table, select Body from Filter array. Here I customize Title and assigned field using the following functions:

 

Title: item()?['Title']

Assigned: item()?['Assigned']?['Email']

 

Add action Send an email. Select HTML output for the body field, and enable Yes for the Is HTML field.

1.PNG2.PNG3.PNG

 

Best regards,

Mabel  

 

Community Support Team _ Mabel Mao
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

Hi @v-yamao-msft ,

 

Thanks for your superswift reply!

 

Indeed what you're describing is what I want to do. When I try your solution however, the Create HTML automatically turns into an 'apply to each' loop. In my test setup I have 3 items from the list that should be emailed to me. When testing this solution,  I receive 3 emails with 3 rows of the same item. So email one contains 3 rows with item A, email 2 contains 3 rows with item B, email 3 contains 3 rows with item C.

 

5.PNG

 

Any ideas why this is?

 

Thanks again!

 

Merel

 

 

Hi @Merel ,

 

In the action Create HTML table, you should select Body from Filter array but not select Value from the action Get items.

 

Please check the screenshot I provided in my previous post and try again with it.

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
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

Hi @v-yamao-msft ,

 

I now see what you mean and it works perfectly! Thank you so much!

 

Merel

Hi @v-yamao-msft   great information is just what I was looking for 🙂

 

Is it possible to get the number of items each person will receive in the email? I would like to include on the subject of the email sent the number of items related to that person. 

 

Thank you in advance!

This solution works really fine. Thanks for that. I have a short question: When I change Recurrence into When a new SharePoint List item is added, the flow sends the emails as much as rows are according to the user. Does anybody know, what I have to change? Thanks

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (6,339)