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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / RemoveIf does not remo...
Power Apps
Answered

RemoveIf does not remove collection item

(1) ShareShare
ReportReport
Posted on by 10
Hey Everyone,

I recently got stuck with a Power Apps scenario. I have a SharePoint list in my Power Apps, which has a multi-person column. In my app I want to patch the current user in and out. 
For adding the user into that column I have a logic which uses collections. Since normal patching would override the whole record, instead I'm creating a collection with the already existing people, then adding the current user in and then I patch it back to the list.
 
I wanted to follow the same logic when I want to remove the user from the list. But somehow I just can't remove the current user from the collection. Am I missing something?
This is how I tried:
 
 
ClearCollect(
    currentParticipants,
    LookUp(My_List, ID = ItemID).Members
);
RemoveIf(
    currentParticipants,
    Claims = "i:0#.f|membership|" & User().Email
);
 
Alternatively I tried doing this way too:
 
ClearCollect(
    currentParticipants,
    Filter(
        currentParticipants,
        Claims <> "i:0#.f|membership|" & User().Email
    )
);
 
None of them work.
Categories:
I have the same question (0)
  • Verified answer
    msoenmez Profile Picture
    46 on at
    Equals operation inside Filter and RemoveIf is case sensitive. Since you are using User().Email and Claims objects, I suggest you check if they actually match, including uppercase and lowercase characters. e.g. Claims object can be "i:0#.f|membership|xyz(at)abc.com" and User().Email can be "XYZ(at)abc.com".
     
    To make sure that equation is always correct you can use following logic : 
     
    ClearCollect(
        currentParticipants,
        LookUp(My_List, ID = ItemID).Members
    );
    RemoveIf(
        currentParticipants,
        Lower(Claims) = "i:0#.f|membership|" & Lower(User().Email)
    );
     
    -------
     
    ClearCollect(
        currentParticipants,
        Filter(
            currentParticipants,
            Lower(Claims) <> "i:0#.f|membership|" & Lower(User().Email)
        )
    );
  • CU23121026-0 Profile Picture
    10 on at
    Thank you @msoenmez
    I completely overlooked on case sensitivity. The modified function works like a charm :) 

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard