cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gofunk1
Helper II
Helper II

Urgent help needed (building a flow)

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:

Gofunk1_0-1637873181028.png

Gofunk1_1-1637873231829.png

Gofunk1_2-1637873259055.png

Thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions
ekarim2020
Super User
Super User

Here are some ideas for you. Briefly:

2021-11-26_00-58-39.png

 

2021-11-26_00-28-32.png

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.

2021-11-26_00-29-43.png

 

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:

 

2021-11-26_00-30-40.png

 

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.

View solution in original post

4 REPLIES 4
ekarim2020
Super User
Super User

Here are some ideas for you. Briefly:

2021-11-26_00-58-39.png

 

2021-11-26_00-28-32.png

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.

2021-11-26_00-29-43.png

 

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:

 

2021-11-26_00-30-40.png

 

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:

 

Gofunk1_0-1637915377225.png

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:

2021-11-26_09-24-08.png

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:

2021-11-26_09-33-41.png

 

 

2021-11-26_09-38-43.png2021-11-26_09-40-39.png

The expression is:

body('Filter_array')[0]?['OwnerEmail']

The flow is based on the following demo list which I re-used for the flow:

2021-11-26_09-22-02.png

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! 🙂

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (2,172)