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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter collection if i...
Power Apps
Unanswered

Filter collection if it contains string

(0) ShareShare
ReportReport
Posted on by 70

Hello,

 

i need a help to construct syntax which would help me to gather collection with name which is not contains "Ext."

 

I tried something like this:

Filter(colMemberCollection, !IsMatch(displayName, " Ext.",MatchOptions.Contains));

 

Or

 

ForAll(colMemberCollection,RemoveIf(IsMatch(displayName, " Ext.",MatchOptions.Contains)));

 

But none of it actually works. 

Thank you.

 

Categories:
  • Martin Dráb Profile Picture
    14 on at

    This works for me:

     

    Filter(colMemberCollection, !IsMatch(displayName, "Ext.", MatchOptions.Contains))

     

     

  • Krentor Profile Picture
    70 on at

    Hello,

    thank you for your answer. I tried that but same result in my collection. I still have in collection in this format "Name, Surname Ext." which i need to exclude.

  • Martin Dráb Profile Picture
    14 on at

    It does the job for me even if I use the same value. Can you please test with the same collection as I did?

    ClearCollect(colMemberCollection, { displayName: "abcd" }, { displayName: "Name, Surname Ext." }, { displayName: "xyz" })

    If it works, we'll know that the problems is somewhere else than the formula.

  • Krentor Profile Picture
    70 on at

    Not sure if it helps but the way i create collection is: 
    ClearCollect(colMemberCollection,Office365Users.DirectReportsV2(varPrihlasenyUzivatel).value);

    From this collection i need to remove employees who have Ext. in their display name.

  • Martin Dráb Profile Picture
    14 on at

    Well, it doesn't really help, because know neither what data you have in colMemberCollection nor what value you're using as the pattern.

     

    What will help is if you test the formula with known parameters, as I suggested. If it works, you'll know that the formula is correct and there is no point in trying to fix it, because the problem lies somewhere else.

     

    Either the data isn't what you think (checking value is the first thing I would do), or you aren't using the formula correctly.

  • Krentor Profile Picture
    70 on at

    Hello,

    sorry for late response as i was busy. However i tried your code:
    ClearCollect(colMemberCollection, { displayName: "abcd" }, { displayName: "Name, Surname Ext." }, { displayName: "xyz" });
    Filter(colMemberCollection, !IsMatch(displayName, "Ext.", MatchOptions.Contains));

    and in collection colMemberCollection i can still see all three records, including one with Ext. Per my understanding, it should be working, but ist not. Im using this function in OnStart property.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard