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

Check if multi-select people picker has changed

Hi everyone

I have a list that contains an assigned to field which is a people picker field that accepts multiple selections.  I have created a flow with the trigger "When an item is created or modified" which then sends an e-mail to the user(s) in the assigned to field.  This works fine but sends the e-mail every time the item is modified even if the field hasn't changed.

I was thinking of creating a field called previous assigned and initially set this to the value of the assigned to field.  I could then check if the two fields match in the flow and if they don't, send the e-mail notification.  The only issue is I'm not sure how to do this with the multiple choice people picker?  If it was just a single choice field this would be simple but I'm not sure how I can compare a list of users in the multiple choice people picker with a text field?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Check if multi-select people picker has changed

@gj84uw 

A multi-select person or group column contains a collection.  So, one way to approach your issue is to loop through the collection and append each person selected to a string.  See my example below.  I have a multi-select person or group column called PG where I have entered two people.  The compose action at the end is there just to show the result - you won't need it if you implement this solution.  You can store the string in your additional column.  Then create a new string when the item changes to compare.

PeopleString1.jpgPeopleString2.jpg

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

2 REPLIES 2
Super User
Super User

Re: Check if multi-select people picker has changed

@gj84uw 

A multi-select person or group column contains a collection.  So, one way to approach your issue is to loop through the collection and append each person selected to a string.  See my example below.  I have a multi-select person or group column called PG where I have entered two people.  The compose action at the end is there just to show the result - you won't need it if you implement this solution.  You can store the string in your additional column.  Then create a new string when the item changes to compare.

PeopleString1.jpgPeopleString2.jpg

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

SudhirSingare
Level: Powered On

Re: Check if multi-select people picker has changed

On page load collect
Collect(ColUsersOnPageLoad, ComboBoxUsers.AllItems)

Then on before submit code.

Collect(ColBeforeSubmit, ComboBoxUsers.AllItems)

and compare two colls: 
 If(Concat(ColUsersOnPageLoad, Email& ",") = (Concat(ColBeforeSubmit, Email & ","), ...


Then you can set hidden column in SPList: AreUsersUpdated = true or false, then this condition you can check before running flow action.

Note: For getting only new users from column is no straight forward as of now, this needs a lot of custom logic.

 

Helpful resources

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

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 (Last 30 Days)
Users online (6,425)