cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

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
Community Support

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
Community Support

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

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Top Kudoed Authors
Users online (8,958)