web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How do you delete a si...
Power Apps
Unanswered

How do you delete a single person in a multi select person or group column?

(0) ShareShare
ReportReport
Posted on by 822 Super User 2025 Season 2

I am using a sharepoint list as a datasource and I want to delete a single person in the column only if
the person' name isnt mentioned in the combo box of the edit screen.

I currently have this formula:

RemoveIf(
                AttachmentParticipants, 
                CID = locCurrentRecord.ID
);   
 

for example. my list has a column named "Participants" and its a multi select person or group column
in the list I have ID = 200 and person named Winter and Snow.

in the edit screen the user plans to edit the person to Winter and Happy. That means in the "Participants" column I have to remove Snow and retain Winter.

How do I do this?

I have another list which I did something similar but, in this list, the Participants is not multi select meaning it creates an item per participant. In this formula what I did was check if the person mentioned in the list is in the select items of the edit screen's combo box then remove that list item if it doesn't.

ParticipantsResponse and AttachmentParticipants are different lists.

ForAll(
                //ClearCollect(colExistingParticipant, Filter(ParticipantResponse, cID= locCurrentRecord.ID));
                colExistingParticipant As ExistingParticipant, 
                If(
                    //if review participants select in combobox is not existing in the filtered participantcontractresponse list
                    Not( ExistingParticipant.Participant.DisplayName in ForAll(
ReviewParticipantsDataCardValue7_Edit
.SelectedItems, DisplayName)), //condition
                    RemoveIf(
                        ParticipantResponse, 
                        cID= ExistingParticipant.ContractID && (Participant.DisplayName = ExistingParticipant.Participant.DisplayName)
                    );
                
                    
                );
                
            );
Categories:
I have the same question (0)
  • MarkRahn Profile Picture
    1,147 Super User 2025 Season 2 on at
    How do you delete a single person in a multi select person or group column?
    Hi,
     
    I'm going to assume you have a reason for doing this instead of using a Form connected to your SharePoint List.
     
    You don't need to so much "remove" users as just set the field to the users you want. You already said if the user is not selected then you want them removed. This essentially means you want to set the field to what the user selected.
     
    First you need to build a collection of the Selected Users:
    ClearCollect(
        colSelectedUsers,
        ForAll(
            ComboBoxUsers.SelectedItems,
            {
                '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
                Claims: "i:0#.f|membership|" & Lower(Email),
                DisplayName: DisplayName,
                Email: Email
            }
        )
    );
    
    Then Patch your list with the collection:
    Patch(
        'YourSharePointList',
        Lookup('YourSharePointList', ID = locCurrentRecord.ID),
        {
            MultiSelectPersonField: colSelectedUsers
        }
    );
     
     
    Take a look at this article by Matthew Devaney which provides more examples and detail:
     
    If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a Like.
     
    Thanks
    -Mark
     
  • KevinGador Profile Picture
    822 Super User 2025 Season 2 on at
    How do you delete a single person in a multi select person or group column?
    actually the combobox is already connected to a list.

    Lets name it Review List.

    This Review List has a column named participants each item created creates an entry for 2 dependent list named

    Participants and AttachmentParticipants. 

    Participant list doesnt have participant column multi select enabled. 

    while AttachmentParticipants is multi select enabled. 

    I cant just patch because it will remove the action made by the existing participant for both the list.

     
  • WarrenBelz Profile Picture
    152,847 Most Valuable Professional on at
    How do you delete a single person in a multi select person or group column?
    I will add this as I felt like fried brain for breakfast on a Sunday Morning . . .
    Firstly the fundamental problem is that as Remove/RemoveIf removes an entire record, you cannot use it to remove selected values from a multi-value field, so you need to (as MarkBandR  as noted) update the entire field with the new desired contents. From what I am reading (and if I am wrong please disregard) you want to:-
    • Remove anything from the existing field that is not in the Combo Box BUT
    • Not add anything new in the Combo Box that is not in the field (if you wanted to do this, you would simply patch the combo box to the field)
    The main issue is that you have a many-to-many comparison, a process which works fine in the positive, but not in the negative. The code below may not be what you need, but it will update the multi-person field Participant in the list ExistingParticipant only retaining items that are present in the Combo Box ReviewParticipantsDataCardValue7_Edit
    Also I do not know the Items of the Combo Box- the code will work if it based on Choices(ExistingParticipant.Participant), however if you are using Office365Users.SearchUser(), there are a couple of places that will need changing.
    With(
       {
          _Current: 
          LookUp(
             ExistingParticipant,
             ID = 200,
             Participant
          ),
          _New: ReviewParticipantsDataCardValue7_Edit.SelectedItems
       },
       With(
          {
             _Update: 
             Ungroup(
                ForAll(
                   _Current As _C,
                   Filter(
                      _New,
                      _C.Email in Email
                   )
                ),
                Value
             )
          },
          Patch(
             ExistingParticipant,
             {
                ID: 200,
                Participant: 
                ForAll(
                   _Update As _U,
                   {
                      Claims: _U.Claims,
                      Department: _U.Department,
                      DisplayName: _U.DisplayName,
                      Email: _U.Email,
                      JobTitle: _U.JobTitle,
                      Picture: _U.Picture
                   }
                )
             }
          )
       )
    )
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
     
  • MarkRahn Profile Picture
    1,147 Super User 2025 Season 2 on at
    How do you delete a single person in a multi select person or group column?
    Hi ,
     
    Warren has the right answer. I missed the part where you were looking for the intersection of two. His solution makes an excellent use of "With".
     
    I also found this example by Matthew Devaney of another technique for intersection:
     
    -Mark
  • KevinGador Profile Picture
    822 Super User 2025 Season 2 on at
    How do you delete a single person in a multi select person or group column?
    thanks both of you. 

    I will have to test Warren's code first and come back here if I encountered any problems. 

    I really appreciate the help and new knowledge on dealing with such situations
  • KevinGador Profile Picture
    822 Super User 2025 Season 2 on at
    How do you delete a single person in a multi select person or group column?
    @WarrenBelz 

    first of all thanks! The items of the combo box is Choices() 
    I personally havent still understood ungroup but I see this formula makes a lot of sense. 

    I seem to get an error with  _C.Email because it wont me put .Email

    heres my code below:
     
    //Update Attachment Participants
                ForAll(
                    LookUp('Contract Review', ID = gvarEditContractID_rec).Attachments As Attachment, 
                    ForAll(
                        colExistingParticipant As ExistingParticipants, 
                        With(
                            {
                                _Current: 
                                LookUp(
                                    colExistingParticipant, 
                                    ContractID = locCurrentRecord.ID, 
                                    Participant
                                ),
                                _New: ReviewParticipantsDataCardValue7_Edit.SelectedItems
                            }, 
                            With(
                                {
                                    _Update: 
                                    Ungroup(
                                        ForAll(
                                            _Current As _C,
                                            Filter( 
                                                _New, 
                                                _C.Email in Email -- error here, when I put _C. it doesnt pick up anything error in this line says invalid argument type
                                            )
                                        ),
                                        Value 
                                    )
                                }, 
     
  • WarrenBelz Profile Picture
    152,847 Most Valuable Professional on at
    How do you delete a single person in a multi select person or group column?
    As I mentioned in the post, the code is only valid if you are using Choices(ExistingParticipant.Participant)as the Items of the Combo Box - I am assuming now that you are using Office365Users.SearchUser, which outputs a different schema. You have also added another two elements at the top of the code, so I am not sure what you are doing there, but my approach based on what you have posted earlier would now be
    With(
       {
          _Current: 
          LookUp(
             ExistingParticipant,
             ID = 200,
             Participant
          ),
          _New: ReviewParticipantsDataCardValue7_Edit.SelectedItems
       },
       With(
          {
             _Update: 
             Ungroup(
                ForAll(
                   _Current As _C,
                   Filter(
                      _New,
                      _C.Email in Mail
                   )
                ),
                Value
             )
          },
          Patch(
             ExistingParticipant,
             {
                ID: 200,
                Participant: 
                ForAll(
                   _Update As _U,
                   {
                      Claims: "i:0#.f|membership|" & Lower(_U.Mail),
                      Department: _U.Department,
                      DisplayName: _U.DisplayName,
                      Email: _U.Mail,
                      JobTitle: _U.JobTitle,
                      Picture: ""
                   }
                )
             }
          )
       )
    )
    The Ungroup function is necessary as when iterating through a Table with ForAll and producing an output on each with Filter(), each iteration produces a single Table field called Value containing all the output and that needs to be ungrouped at the end to split it all out into single records.
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • KevinGador Profile Picture
    822 Super User 2025 Season 2 on at
    How do you delete a single person in a multi select person or group column?
     I apologize for not being detailed with this question. 

    First I wanted to ask how do you mention people in this new forum? It seems like @ doesnt seem to work. 

    I have mentioned in my most recent reply that the combo box is indeed using Choices for it item property

    I appreciate you being patient with me. 

    I got the formula to work for me now. 

    My problem is that I need it to iterate over my collection called colAttachmentParticipants which is a collection I created  using this formula
     
    ClearCollect(
       colExistingAttachmentParticipant, 
       Filter(AttachmentParticipants, ContractID = locCurrentRecord.ID )  
    );

    How will I iterate over this and patch each of the items Participant? Should I use UpdateIf here? 
     
    With( 
                    {
                        _Current: 
                        LookUp( 
                            colExistingAttachmentParticipant, 
                            ID = locCurrentRecord.ID, 
                            ReviewParticipants
                        ), 
                        _New: ReviewParticipantsDataCardValue7_Edit.SelectedItems
                    }, 
                    With(
                        { 
                            _Update: 
                            Ungroup( 
                                ForAll(
                                    _Current As _C, 
                                    Filter( 
                                        _New, 
                                        _C.Email in Email
                                    )
                                ), 
                                Value
                            )
                        }, 
                        ForAll(
                            colExistingAttachmentParticipant As CurrentAttachmentItem, 
                            Patch( 
                                AttachmentParticipants, 
                                {
                                    ReviewParticipants: 
                                    ForAll( 
                                        _Update As _U, 
                                        { 
                                            Claims: _U.Claims, 
                                            Department: _U.Department, 
                                            DisplayName:  _U.DisplayName, 
                                            Email: _U.Email, 
                                            JobTitle: _U.JobTitle, 
                                            Picture: _U.Picture 
                                        }
                                    )
                                }
                            )
                        )
                    )//attachment participant patching inner with end bracket
                );//attachment participant patching outer with end bracket





     
  • KevinGador Profile Picture
    822 Super User 2025 Season 2 on at
    How do you delete a single person in a multi select person or group column?
    @Warren 

    I have tried this code below but it doesnt remove or update the list based on the selected items of the combo box
     
    With( 
                    {
                        _Current: 
                        LookUp( 
                            colExistingAttachmentParticipant, 
                            ID = locCurrentRecord.ID, 
                            ReviewParticipants
                        ), 
                        _New: ReviewParticipantsDataCardValue7_Edit.SelectedItems
                    }, 
                    With(
                        { 
                            _Update: 
                            Ungroup( 
                                ForAll(
                                    _Current As _C, 
                                    Filter( 
                                        _New, 
                                        _C.Email in Email
                                    )
                                ), 
                                Value
                            )
                        }, 
                        ForAll(
                            colExistingAttachmentParticipant As CurrentAttachmentItem, 
                            UpdateIf( 
                                AttachmentParticipants, 
                                ContractID = CurrentAttachmentItem.ContractID && (Title = CurrentAttachmentItem.Title), 
                                {
                                    ReviewParticipants: 
                                    ForAll( 
                                        _Update As _U, 
                                        { 
                                            Claims: _U.Claims, 
                                            Department: _U.Department, 
                                            DisplayName:  _U.DisplayName, 
                                            Email: _U.Email, 
                                            JobTitle: _U.JobTitle, 
                                            Picture: _U.Picture 
                                        }
                                    )
                                }
                            )
                        )
                    )//attachment participant patching inner with end bracket
                );//attachment participant patching outer with end bracket
     
  • WarrenBelz Profile Picture
    152,847 Most Valuable Professional on at
    How do you delete a single person in a multi select person or group column?
     
    Your Initial post referenced a record with an ID of 200, so I built a model using your actual list, field and control names to resolve this rather complex many to many filter involving a multi-value field type. The output was as expected. This may work (it will take a while to run), but I cannot test it.
     
    ForAll(
       colExistingAttachmentParticipant As _Item,
       With(
          {
             _Current: LookUp(
                ExistingParticipant,
                ID = _Item.ID,
                Participant
             ),
             _New: ReviewParticipantsDataCardValue7_Edit.SelectedItems
          },
          With(
             {
                _Update: Ungroup(
                   ForAll(
                      _Current As _C,
                      Filter(
                         _New,
                         _C.Email in Email
                      )
                   ),
                   Value
                )
             },
             Patch(
                ExistingParticipant,
                {
                   ID: _Item.ID,
                   Participant: ForAll(
                      _Update As _U,
                      {
                         Claims: _U.Claims,
                         Department: _U.Department,
                         DisplayName: _U.DisplayName,
                         Email: _U.Email,
                         JobTitle: _U.JobTitle,
                         Picture: _U.Picture
                      }
                   )
                }
             )
          )
       )
    )

    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee


Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard