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

Filtering items from SharePoint list before emailing different people

Hi All,

 

I am trying to build a flow that will be run once a month, so has a scheduled trigger for that.

 

Then I want it to Get items from a SharePoint list which is straight forward.

 

The next two steps are in an image below.

After that create an HTML table with the results.

 

This is the part I am having difficulty with:

There is a person column in the SharePoint list called "Manager".

I want the flow to send an email to this person, but to only include the items where this person is in the Manager field.

 

So all people in the manager field should have an email sent to them with a different version of the SharePoint list filtered only to the items where they are the manager.

 

E.g.

Title          Number              Name                                                 Manager

Mr             123                  Bob.Jones@company.com            Karen.Smith@company.com

Ms            532                  Andrea.Wall@company.com          Adam.Jones@company.com

Mr            333                  Ken.McKay@company.com           Adam.Jones@company.com

Ms           1111                  Alice.Johnson@company.com      Karen.Smith@company.com

Mr           2234                   John.James@company.com        Karen.Smith@company.com

 

Manager Karen Smith would get an email that has:

Mr 123 Bob.Jones@company.com

Ms 1111 Alice.Johnson@company.com

Mr 2234 John.James@company.com

 

While Manager Adam Jones would get an email with:

Ms 532 Andrea.Wall@company.com

Mr 333 Ken.McKay@company.com

 

Thanks!

Roy

 

SP_Flow.jpg

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support Team
Community Support Team

Re: Filtering items from SharePoint list before emailing different people

Hi @ roy_t,

 

 

I have made a test on my side,I have created a list in sharepoint as below:

Capture.PNG

 

please refer to sscreenshot below to create the flow: 

Capture.PNGCapture1.PNGCapture2.PNG

 

Note :

The expression in the "Set variable" action as below:

union(variables('all Managers with same'),variables('all Managers with same'))
The expression in the "Set variable" action as below:
The Title expression in the select as below:
item()?['Title']
The Numder expression in the select as below:
item()?['Numder']
The User Name expression in the select as below:
item()?['User_x0020_Name']
 
The flow would run successfully as below to send the email:
Capture.PNG

 

 

 

Regards,
Alice Zhang

View solution in original post

2 REPLIES 2
Highlighted
Community Support Team
Community Support Team

Re: Filtering items from SharePoint list before emailing different people

Hi @ roy_t,

 

 

I have made a test on my side,I have created a list in sharepoint as below:

Capture.PNG

 

please refer to sscreenshot below to create the flow: 

Capture.PNGCapture1.PNGCapture2.PNG

 

Note :

The expression in the "Set variable" action as below:

union(variables('all Managers with same'),variables('all Managers with same'))
The expression in the "Set variable" action as below:
The Title expression in the select as below:
item()?['Title']
The Numder expression in the select as below:
item()?['Numder']
The User Name expression in the select as below:
item()?['User_x0020_Name']
 
The flow would run successfully as below to send the email:
Capture.PNG

 

 

 

Regards,
Alice Zhang

View solution in original post

roy_t
Level: Powered On

Re: Filtering items from SharePoint list before emailing different people

Hi Alice,

 

This is excellent - thank you! I have just got it working.

 

A note for anyone looking to make the same - the Apply to each 2 input is "all Managers without same" (the field is cut off in the picture).

 

Thanks again!

Roy

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons in April

Read the announcement for more information!

firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

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
Top Kudoed Authors
Users online (5,113)