Skip to main content

Notifications

Community site session details

Community site session details

Session Id : yTRbCWJrKmkJWpRgT14xIc
Power Apps - Building Power Apps
Answered

Filter gallery by search containing wildcard characters

Like (0) ShareShare
ReportReport
Posted on 12 Mar 2021 10:59:43 by 8

Hi everyone! I am new, learning PowerApps and would like to ask if somebody could help me with the following problem:

I have a gallery connected to a SP list containing various products, here is an example of the list:

Product
Dogfood
Parrotfood
Collardog
Toysparrot

 

I built a searchbox with Filter(in) which works well if you would like to search for every product that contains "dog" it will give you Dogfood and Collardog in the gallery. But I would like to separate those searches so that when I type in "*dog" it will give me only Collardog or if I type "dog*" it will only return Dogfood (or any wildcard character, doesn't have to be *) .

 

I tried to play with Startswith and Endswith but I am too inexperienced to set it up if it's even possible to do it with those functions.

 

I would appreciate any help! Thank you!

  • bladerunner Profile Picture
    8 on 12 Mar 2021 at 12:54:22
    Re: Filter gallery by search containing wildcard characters

    Thank you @rubin_boer so much! This is perfect!

     

    I will do the rest myself 🙂

     

    Just a question, would the same formula be used for entries that are number based? Since you used Lower() here? Let's say if instead a name of the product we have an ID containing 10 characters?

     

    Thanks!

  • Verified answer
    rubin_boer Profile Picture
    4,841 Super User 2024 Season 1 on 12 Mar 2021 at 11:39:12
    Re: Filter gallery by search containing wildcard characters

    @bladerunner this was fun

     

    No Filter

    rubin_boer_0-1615553442571.png

    No wildcard

    rubin_boer_1-1615553470847.png

    Wildcard (xyz*)

    rubin_boer_2-1615553502653.png

    rubin_boer_3-1615553558455.png

    Wildcard (*xyz)

    rubin_boer_4-1615553603531.png

     

     

    Hr is the function for items

    this only check for start and end , im sure you can add a sequenbce to its as well.

    Switch(true,
    And(IsBlank(Find("*",txtInput2.Text)),!IsBlank(txtInput2.Text)), Filter(aList,txtInput2.Text in Value),
    IsBlank(txtInput2.Text),aList,
    (Find("*",txtInput2.Text) = 1),Filter(aList, Lower(Mid(txtInput2.Text,2, Len(txtInput2.Text)-1)) in Mid(Value,1,Len(txtInput2.Text)-1)),
    (Find("*",txtInput2.Text) > 1),
    Filter(aList,
    Lower(Mid(txtInput2.Text, 1,Len(txtInput2.Text)-1)) in Lower(Mid(Value,Len(Value) - Find("*", txtInput2.Text,1)+2,Len(txtInput2.Text)-1))))

     

     

     

     

     
  • bladerunner Profile Picture
    8 on 12 Mar 2021 at 11:30:07
    Re: Filter gallery by search containing wildcard characters

    hi @rubin_boer thanks for the link but unfortunately this is what I already have.

    On your example for jack - I set it up so I get if the entry contains jack but I want to add a wildcard character so I can specify if i want an entry that ends with jack (*jack) or that starts with jack (jack*). Is that possible?

     

    Thanks!

  • rubin_boer Profile Picture
    4,841 Super User 2024 Season 1 on 12 Mar 2021 at 11:19:20
    Re: Filter gallery by search containing wildcard characters

    hi @bladerunner havea look at this https://powerusers.microsoft.com/t5/Building-Power-Apps/Combo-Box-wildcard-search/td-p/672356

     

    hope it helps you

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard
Loading started