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?
Solved! Go to Solution.
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.
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.
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.
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!
User | Count |
---|---|
17 | |
14 | |
7 | |
6 | |
5 |
User | Count |
---|---|
24 | |
18 | |
10 | |
8 | |
7 |