cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gj84uw
Helper II
Helper II

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
ScottShearer
Super User III
Super User III

@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
ScottShearer
Super User III
Super User III

@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
Helper I
Helper I

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
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

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

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (88,300)