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
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
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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 310 members 3,453 guests
Please welcome our newest community members: