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 gallery by sear...
Power Apps
Answered

Filter gallery by search containing wildcard characters

(0) ShareShare
ReportReport
Posted on 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!

Categories:
I have the same question (0)
  • rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    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

     
  • bladerunner Profile Picture
    8 on at

    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!

  • Verified answer
    rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    @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 at

    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!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard