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 / 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:
I have the same question (0)
  • 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

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard