cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Drew_Shdz
New Member

Send email with all items in a list to assigned user

Hi all,

I have a list in a SharePoint site. There is a field in the list called 'assesed_by' which a user can populate by selecting from a list of people in the business. There is also another field called 'Status'.

I would like to create a flow that every Monday, will send an email to the person in the 'assessed_by' field with a list of ALL items assessed by them and that have a status of 'Pending'.

1. I have already had a go at this but can't seem to send an email to a particular user with just THEIR pending items - I keep getting ALL pending items

2. I have tried using an array but am struggling in implementing it effectively
1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

 

Hi @Drew_Shdz ,

 

The first thing we need to confirm is whether the assessed_by field supports multiple selections. If it does not allow multiple selections, and the type of the Status field is choice, you could refer to the following method to configure Flow.

 

  • Use Condition to filter out the items whose Status value is equal to Pending, and then append the attached_by Email to the variable.
  • Use the union() function to remove duplicates from the array UserEmail() function, and then filter the items according to the useremail.
  • Filter out the items equal to the current email and the Status value is Pending, and append the fields that need to be displayed in the message to the HtmlTable variable in JSON format.
  • After each traversal is completed, you need to empty the HtmlTable variable to avoid superimposing the data.

Image reference:

Over All.PNG

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
AKRogers
Helper V
Helper V

Hi @Drew_Shdz,

 

The basic idea here is to filter your initial results based on the People Picker value.  However, as far as I know that can't be handled easily just by using the Filter Query part of a Get Items action for SharePoint since the people picker returns a slew of values.  Instead, I would handle this using our good friend HTTP call to SharePoint and build your filter into your REST call.  There may be a better or more elegant way to do this (I don't love all the loops), but this is how I'd handle it:

PeoplePicker1-111619.png

 

PeoplePicker2-111619.png

 

PeoplePicker3-111619.png

 

Some additional notes:

  • You don't necessarily have to do the initial call for all items in the list if you're going to flag some of them as complete, etc.  Just build the appropriate filter into your GET.
  • When creating the schema for your parse JSON you may get some null values.  Refer to  this blog by John Liu  for some insight on how to handle that!
  • You'll need to build an initial array to gather the IDs from the people picker.  Don't leave out the step where you check to see if the ID already exists in the array so that you don't return the same subset of data multiple times.

 

Let me know how it goes!

 

Ashley

If this response provided an answer to your question please mark it as a solution so that others can find it.

If you found this helpful, consider giving it a thumbs up!

v-bacao-msft
Community Support
Community Support

 

Hi @Drew_Shdz ,

 

The first thing we need to confirm is whether the assessed_by field supports multiple selections. If it does not allow multiple selections, and the type of the Status field is choice, you could refer to the following method to configure Flow.

 

  • Use Condition to filter out the items whose Status value is equal to Pending, and then append the attached_by Email to the variable.
  • Use the union() function to remove duplicates from the array UserEmail() function, and then filter the items according to the useremail.
  • Filter out the items equal to the current email and the Status value is Pending, and append the fields that need to be displayed in the message to the HtmlTable variable in JSON format.
  • After each traversal is completed, you need to empty the HtmlTable variable to avoid superimposing the data.

Image reference:

Over All.PNG

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (54,231)