web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details
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!

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

     

     

     

     

     

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 714 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 419 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 243

Last 30 days Overall leaderboard
Loading complete