Hi
I've created a simple tool that will send an email and a teams message to a user based on a SharePoint list contact date field.
I didn't however, take into consideration that people would put multiple entries in with the same date! One user has put 29 entries in for Monday, and with the way the flow is configured now, will get 29 emails and messages on Monday.
So, I'd like to consolidate all items for a given user into one email and message. Any advice on how to do this please?
Here is the current flow:
Thanks!
Solved! Go to Solution.
Here are some ideas for you. Briefly:
We can start with a filter query to get required record items. Replace field_3 with the internal name of your SharePoint field Contact Date. See: What is SharePoint column internal name and where to find it
Next we get a all the Owner names using the Select action, then we remove the duplicate Owner names using the union function. We should now have a unique list of Owner names.
We can then loop through each Owner name, use Filter array to get the all of the Owner's SharePoint items. The Select action is used to select the column we want in the email/Teams message. In the example the field is called field_1, in your case it is going to be Title:
In the Compose Message I am simulating an email message.
To: Anum.Ramos@#########
Subject: Reminder to contact today
Please remember to contact:
Margaret Cook, Catherine Walker
and update your comments and next contact date on the client area.
To: Eugene.George@##########
Subject: Reminder to contact today
Please remember to contact:
Joe Fields
and update your comments and next contact date on the client area.
Hope this helps.
Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.
Here are some ideas for you. Briefly:
We can start with a filter query to get required record items. Replace field_3 with the internal name of your SharePoint field Contact Date. See: What is SharePoint column internal name and where to find it
Next we get a all the Owner names using the Select action, then we remove the duplicate Owner names using the union function. We should now have a unique list of Owner names.
We can then loop through each Owner name, use Filter array to get the all of the Owner's SharePoint items. The Select action is used to select the column we want in the email/Teams message. In the example the field is called field_1, in your case it is going to be Title:
In the Compose Message I am simulating an email message.
To: Anum.Ramos@#########
Subject: Reminder to contact today
Please remember to contact:
Margaret Cook, Catherine Walker
and update your comments and next contact date on the client area.
To: Eugene.George@##########
Subject: Reminder to contact today
Please remember to contact:
Joe Fields
and update your comments and next contact date on the client area.
Hope this helps.
Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.
Hi Ellis
Thanks for taking the time to write this! It is excellent!
Only issues I'm having is capturing the email at the final step:
If I use body('Filter_array')[0]?['OwnerEmail'], the field is empty, but if I use body('Filter_array')[0]?['Owner'] it does pick up the correct contact. Not sure why when I specify email it doesn't return anything?
Have a look at the run time outputs for the flow. Please expand the Filter Array action:
In the Filter array action you should see all the items that are being filtered from the SharePoint List. Have a look at the data, scroll down if needed and find the Owner field. It may have a different name compared to the demo below:
The expression is:
body('Filter_array')[0]?['OwnerEmail']
The flow is based on the following demo list which I re-used for the flow:
Hope this helps.
Ellis
Thanks - I've figured it out! I had allowed multiple selections enabled on the SharePoint list. All working after turning that off.
Thanks for your help mate! 🙂
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
31 | |
29 | |
28 | |
18 | |
11 |