cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Community Support
Community Support

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

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

Highlighted
Community Support
Community Support

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

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
Highlighted
Community Support
Community Support

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

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

Highlighted
Advocate II
Advocate II

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

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

 

 

Highlighted
Community Support
Community Support

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

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

Highlighted
Advocate II
Advocate II

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

Hi @v-yamao-msft ,

 

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

 

Merel

Highlighted
Helper III
Helper III

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

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!

Highlighted
New Member

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

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
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (6,859)