cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ullurr
Level: Powered On

flow to send single email for set of records in Sharepoint list to multiple receipent.

I am trying to setup a flow to send single email for set of records in Sharepoint list to multiple receipent.

We have a Sharepoint list with document due data and responsible person. there will be multiple records expired on given date so we need to send one email with all the document detals to responsible person in the list

 

I have tried following post but not able to fix. Flow will run for all the records and fails. Do untill @empty(variables('NameArray')) is not working i think.

 

https://powerusers.microsoft.com/t5/General-Flow-Discussion/How-to-send-multiple-List-Items-in-singl...

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: flow to send single email for set of records in Sharepoint list to multiple receipent.

Hi @ullurr,

 

What do you mean that each responsible person receives a separate email containing only its own upcoming expiring items?

You could improve the configuration of the previous Flow in this way.

This time, the responsible person is used as a reference.

Use the responsible person to perform another screening based on the first Filter array. This time the filter condition is the relevant responsible person, and then create the Html table.

Full screen shoot of Flow:

33.PNG

 

Apply_to_each/Compose/Set variable:

34.PNG

Apply_to_each:

35.PNG

Please take a try and let me know if you have any question.

 

Best Regards,

Barry

 

 

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
7 REPLIES 7
Highlighted
Community Support Team
Community Support Team

Re: flow to send single email for set of records in Sharepoint list to multiple receipent.

Hi @ullurr,

 

I assume that your list has a due date column, and each item has a respondable person column(probably the user's email address).

So your need is to check which items in the list are expiring due date, and then send an email to remind the corresponding person on the item.

I have a workaround here, maybe you could try it.

SharePoint list for test:

23.PNG

1.Use Recurrence as the trigger, the cycle you could freely set, such as one or three days

2.Configure Get items to get all the items, then use Filter array to filter out the items that are about to expire.

     If you want to filter the items that are due today, you could retain the Date portion of utcNow() using the formatDateTime() function.

 formatDateTime(utcNow(),'yyyy-MM-dd')

 

      If you want to filter the items that are about to expire, add addDays().

 

formatDateTime(addDays(utcNow(),-1),'yyyy-MM-dd')

18.PNG3.Use Create html table action to organize the previously acquired items together. If you don't know the name of the field, you can first check the field name output in the Filter array.

19.PNG

4.Use the variable to store the user's email address, then use the union() function to remove the duplicates, avoiding multiple instances of the respondent person being the same person, and then using the Join action to change the comma between the email addresses to ''; ".

20.PNG

5.Configure the Send an email action, configure the output of the Join action in the To field, and use the output of the Create html table action on the body.

Full screen shoot:

22.PNG

Please take a try and let me know if you have any question.

 

Best Reagards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ullurr
Level: Powered On

Re: flow to send single email for set of records in Sharepoint list to multiple receipent.

Hi Barry,

 

Thank you for the help, 

 

I have tried the steps you have provided i am now getting one mail but i am getting others line items also in my mail. I should get only line item i am responsible.

For examplie i have 10 List item 4 belongs to Me and 3 to user1 and 3 to user2 all should get one  mail with line item details

Community Support Team
Community Support Team

Re: flow to send single email for set of records in Sharepoint list to multiple receipent.

Hi @ullurr,

 

What do you mean that each responsible person receives a separate email containing only its own upcoming expiring items?

You could improve the configuration of the previous Flow in this way.

This time, the responsible person is used as a reference.

Use the responsible person to perform another screening based on the first Filter array. This time the filter condition is the relevant responsible person, and then create the Html table.

Full screen shoot of Flow:

33.PNG

 

Apply_to_each/Compose/Set variable:

34.PNG

Apply_to_each:

35.PNG

Please take a try and let me know if you have any question.

 

Best Regards,

Barry

 

 

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ullurr
Level: Powered On

Re: flow to send single email for set of records in Sharepoint list to multiple receipent.

Hi @barry,

 

Thank you for the help. It's working Now. 

 

Regards,

Ullur

 

ovis2018
Level: Powered On

Re: flow to send single email for set of records in Sharepoint list to multiple receipent.

Thanks for this post! This worked for my need as well! PHEW! = D

Flow Staff Sunay
Flow Staff

Re: flow to send single email for set of records in Sharepoint list to multiple receipent.

There is a better way to do this - using the "Join" function

I also recommend going through the walkthrough here: https://aka.ms/AdvancedPracticesAndPatterns - it explicitly helps solve scenarios like yours.

See example in screenshots:

image.pngimage.png

 

ovis2018
Level: Powered On

Re: flow to send single email for set of records in Sharepoint list to multiple receipent.

Hi @v-bacao-msft  - what can be done to resolve the following error? It's taking place when the column of the person being referenced is blank - which will happen often as it's not a required field and will be completed at various points of a process.  Any addage of a "if blank, skip" that you'd suggest adding in somewhere??

Many thanks!

Flow works but error.PNG

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 243 members 5,913 guests
Please welcome our newest community members: