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.
Solved! Go to Solution.
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:
Apply_to_each/Compose/Set variable:
Apply_to_each:
Please take a try and let me know if you have any question.
Best Regards,
Barry
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:
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')
3.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.
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 ''; ".
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:
Please take a try and let me know if you have any question.
Best Reagards,
Barry
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
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:
Apply_to_each/Compose/Set variable:
Apply_to_each:
Please take a try and let me know if you have any question.
Best Regards,
Barry
Thanks for this post! This worked for my need as well! PHEW! = D
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:
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!
User | Count |
---|---|
84 | |
81 | |
48 | |
30 | |
23 |
User | Count |
---|---|
28 | |
28 | |
27 | |
21 | |
20 |