cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ullurr
Frequent Visitor

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

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.

View solution in original post

9 REPLIES 9
Community Support
Community Support

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
Frequent Visitor

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

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.

View solution in original post

ullurr
Frequent Visitor

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

 

Highlighted
ovis2018 Helper I
Helper I

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

Power Automate
Power Automate

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 Helper I
Helper I

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

Steph04 Helper I
Helper I

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

Hi @v-bacao-msft !

 

I'm working on a flow that operates just as the case explained above. (It should send a single email to the responsible "Supervisor" with an HTML table showing the tasks that have overdue and with Status = Programado)

 

The flow works fine (I have followed all the steps you pointed above) but I'm having an issue with the "Send an email" part, I'm not getting the "current item" option that should go on the To field... I made some testing putting my email in the To field and the flow works perfect but as I havent being able to put the email of the correspondant supervisor the flow havent work as it should.

 

1.JPG12.JPG23.JPG34.JPG45.JPG5

 

 

 

Please Help!

 

 

Steph04 Helper I
Helper I

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

Hi @ullurr @ovis2018 

 

What did you do to make the flow filter the items by responsible?

 

I followed the steps Barry posted and the flow sends the email to the responsible but it sends the list of all of the items that are overdue... It doesn´t filter the tasks by responsible...

 

Help!

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: 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!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (8,133)