Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

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

(0) ShareShare
ReportReport
Posted on by 645 Super User 2025 Season 1

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)
                    );
                
                    
                );
                
            );
  • WarrenBelz Profile Picture
    148,743 Most Valuable Professional on at
    How do you delete a single person in a multi select person or group column?
    OK -  revision that may be of assistance  â€‹â€‹â€‹â€‹â€‹â€‹
    MarkBandR - that is useful knowledge confirming what I have observed. I suspect that using "working" resources rather than "storage" resources may be more efficient.
    ForAll( 
       colExistingAttachmentParticipant As _Item,
       With(
          {
             _Current: 
             LookUp( 
                AttachmentParticipants, 
                ContractID = _Item.ContractID && Title = _Item.Title
             ),
             _New: ReviewParticipantsDataCardValue7_Edit.SelectedItems
          }, 
          With( 
             { 
                _Update1: 
                Ungroup( 
                   ForAll( 
                      _Current.NotRequiredParticipants As _C1, 
                      Filter( 
                         _New, 
                         _C1.Email in Email 
                      )
                   ), 
                   Value
                ), 
                _Update2: 
                Ungroup( 
                   ForAll( 
                      _Current.ReviewParticipants As _C2, 
                      Filter( 
                         _New, 
                         _C2.Email in Email 
                      )
                   ), 
                   Value
                ), 
                _Update3: 
                Ungroup( 
                   ForAll( 
                      _Current.ReviewedParticipants As _C3, 
                      Filter( 
                         _New,
                         _C3.Email in Email 
                      )
                   ), 
                   Value
                ) 
             }, 
             Patch( 
                AttachmentParticipants, 
                {
                   ID: _Item.ID,
                   NotRequiredParticipants: 
                   ForAll( 
                      _Update1 As _U1, 
                      {
                         Claims: _U1.Claims, 
                         Department: _U1.Department, 
                         DisplayName: _U1.DisplayName, 
                         Email: _U1.Email, 
                         JobTitle: _U1.JobTitle, 
                         Picture: _U1.Picture
                      }
                   ),
                   ReviewParticipants: 
                   ForAll( 
                      _Update2 As _U2, 
                      {
                         Claims: _U2.Claims, 
                         Department: _U2.Department, 
                         DisplayName: _U2.DisplayName, 
                         Email: _U2.Email, 
                         JobTitle: _U2.JobTitle, 
                         Picture: _U2.Picture
                      }
                   ), 
                   ReviewedParticipants: 
                   ForAll( 
                      _Update3 As _U3, 
                      {
                         Claims: _U3.Claims, 
                         Department: _U3.Department, 
                         DisplayName: _U3.DisplayName, 
                         Email: _U3.Email, 
                         JobTitle: _U3.JobTitle, 
                         Picture: _U3.Picture
                      }
                   )
                } 
             )
          )
       )
    );
     
  • MarkRahn Profile Picture
    1,061 Super User 2025 Season 1 on at
    How do you delete a single person in a multi select person or group column?
    Hi Warren and Kevin,
     
    Just to see I did some tests with Using Collections and Using With.
    The "Using With" method/code was about 30% faster in the testing I did.
     
    Note: I reset the item each time before running the code because it made a difference on testing if the item columns being updated had a different number of users selected.
     
    Thanks Warren. I learned some good information on this one.
     
    -Mark
  • KevinGador Profile Picture
    645 Super User 2025 Season 1 on at
    How do you delete a single person in a multi select person or group column?
    yes that is the answer. Thanks a lot for both of you to guiding me to the right direction! Oh yes thanks for pointing that out. I will modify the for all at the top. 
  • WarrenBelz Profile Picture
    148,743 Most Valuable Professional on at
    How do you delete a single person in a multi select person or group column?
    I have marked the latest code I posted - so you still want to loop through a collection ? I am not sure how the top lookup which returns a single specific record is going to interact with a potentially different record in the bottom Patch (the ForAll needs to be at the top I think), however I am offline for the next day or so and not able to do any more model testing.
  • KevinGador Profile Picture
    645 Super User 2025 Season 1 on at
    How do you delete a single person in a multi select person or group column?
    there seems to be a bug on this question, I cant mark an answer 
  • KevinGador Profile Picture
    645 Super User 2025 Season 1 on at
    How do you delete a single person in a multi select person or group column?
    WarrenBelz MarkBandR 

    Logic is finally working! With minor hiccups. 

    will update once I am done tweaking the code :) 

    UPDATE:
    1)Ive added a ForAll to loop through all the attachments. 
    2)Ive changed the patching on ReviewParticipants since I need to add those person listed in the combobox.

    What Im trying to understand is how is this code able to remove the existing person in the list that is not in the combo box and as well as retain the person if that person is listed in the combo box? I just cant seem to understand it.

    //Attachment PArticipant Actions
                With(
                    {
                        _Current: LookUp( 
                                    AttachmentParticipants, 
                                    ContractID = locCurrentRecord.ID
                        ),
                        _New: ReviewParticipantsDataCardValue7_Edit.SelectedItems
                    }, 
                    With( 
                        { 
                            _Update1: Ungroup( 
                                ForAll( 
                                    _Current.NotRequiredParticipants As _C1, 
                                    Filter( 
                                        _New, //combobox selected items - EX: Kevin, Ancel
                                        _C1.Email in Email //check all the person listed in AttachmentParticipant list's Not Required Participants column
                                    )
                                ), 
                                Value
                            ), 
                            _Update2: Ungroup( 
                                ForAll( 
                                    _Current.ReviewParticipants As _C2, 
                                    Filter( 
                                        _New, //combobox selected items
                                        _C2.Email in Email //check all the person listed in AttachmentParticipant list's Review Participants column
                                    )
                                ), 
                                Value
                            ), 
                            _Update3: Ungroup( 
                                ForAll( 
                                    _Current.ReviewedParticipants As _C3, 
                                    Filter( 
                                        _New, //combobox selected items
                                        _C3.Email in Email //check all the person listed in AttachmentParticipant list's Reviewed Participants column
                                    )
                                ), 
                                Value
                            ) 
                        }, 
                        ForAll( 
                            colExistingAttachmentParticipant As CurrentAttachmentItem, 
                            Patch( 
                                AttachmentParticipants, 
                                LookUp(
                                    AttachmentParticipants, 
                                    ContractID = CurrentAttachmentItem.ContractID && Title = CurrentAttachmentItem.Title
                                ),
                                {  
                                    NotRequiredParticipants: ForAll( 
                                        _Update1 As _U, 
                                        {
                                            Claims: _U.Claims, 
                                            Department: _U.Department, 
                                            DisplayName: _U.DisplayName, 
                                            Email: _U.Email, 
                                            JobTitle: _U.JobTitle, 
                                            Picture: _U.Picture
                                        }
                                    ),
                                    ReviewParticipants: ForAll( 
                                        _New As _N, 
                                        {
                                            Claims: _N.Claims, 
                                            Department: _N.Department, 
                                            DisplayName: _N.DisplayName, 
                                            Email: _N.Email, 
                                            JobTitle: _N.JobTitle, 
                                            Picture: _N.Picture
                                        }
                                    ), 
                                    ReviewedParticipants: ForAll( 
                                        _Update3 As _U3, 
                                        {
                                            Claims: _U3.Claims, 
                                            Department: _U3.Department, 
                                            DisplayName: _U3.DisplayName, 
                                            Email: _U3.Email, 
                                            JobTitle: _U3.JobTitle, 
                                            Picture: _U3.Picture
                                        }
                                    )
                                } 
                            )
                        )
                    )//inner with end
                );//outer with end

  • KevinGador Profile Picture
    645 Super User 2025 Season 1 on at
    How do you delete a single person in a multi select person or group column?
    Thank you! I ddn't know that modification of replies also give out notifications. Will test this out :) 
  • WarrenBelz Profile Picture
    148,743 Most Valuable Professional on at
    How do you delete a single person in a multi select person or group column?
    I have modified mine to allow for ContractID = locCurrentRecord.ID rather than re-post the update.
  • KevinGador Profile Picture
    645 Super User 2025 Season 1 on at
    How do you delete a single person in a multi select person or group column?
    WarrenBelz 

    I received a reply notif from you at around 13:50 PM PHT and I am currently not able to see it. I don't know what happened :/
  • KevinGador Profile Picture
    645 Super User 2025 Season 1 on at
    How do you delete a single person in a multi select person or group column?
    MarkBandR  - 

    Use case 1 was correct with some misunderstanding. 
    I only need to remove those that are existing in the list but not in the combobox. 

    I really appreciate both of your help with what I am currently stuck on. Really really big help! I would love to put both of your answers as an answer if that's possible to reward both of your hard work in helping me out. 

    For example: 
    I have Winter and Snow existing. 
    and the combobox selected items are Winter and Frost. 

    This is how the end goal should look like: 

    all review participants in the selecteditems of combo box goes to ReviewParticipants by default, they are patched to other column depending on their actions, ideally just want to remove person when theyre not in the combobox for the other 2 columns.

    Case1:
    ReviewParticipants:
    Winter 
    Frost 
    (snow removed)

    NotRequiredParticipants: 
    -none- ( snow removed if listed here )

    ReviewedParticipants: 
    -none- ( snow removed if listed here )

    Case2 (where it retains users that are existing in the list and also in the combo box): 

    ReviewParticipants: 
    Winter
    Frost
    (snow removed)

    NotRequiredParticipants: 
    Winter ( snow removed if listed here )

    ReviewedParticipants: 
    -none-( snow removed if listed here )



     

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1