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 / Search function that c...
Power Apps
Unanswered

Search function that can look for more than one part of a string i.e. by using wildcards

(0) ShareShare
ReportReport
Posted on by 8

Hi,

I do have a search box that is looking for parts of a text string to filter a gallery. Works fine. However, it would be much more powerful, when this search function could look for i.e two parts within the same text string.

 

For Example

Input in search box: 180

Result: all items that have "180" in the text string. I.e 180-10, 180mC, 180MC-10 LSE

 

Input in search box: 180 LSE

Result: Currently - no item because the sting "180 LSE" is not in the table. However, it would be great if with this two search terms the product 180MC-10 LSE would appear in the result.

 

Does PowerApps knows wildcards?

 

Thanks for your support

 

Regards - Andreas

Categories:
I have the same question (0)
  • cds Profile Picture
    1,001 on at

    SearchInput.Text in Column.Name

  • Verified answer
    v-yutliu-msft Profile Picture
    on at

    Hi @AndreasGrosse ,

    In PowerApps, you could use regular expression when compare data.

    The common predefined patterns like ",.*%#" all work in PowerApps.

    However, please note that regular expression could only refer constant value as format.

    The data that you entered in textinput need to be used as Textinput.Text.

    This is not constant value.

    So using regular expression not work for this situation.

    Here are some examples that could use regular expression to compare:

    1)IsMatch( TextInput1.Text, "hello", Contains & IgnoreCase )

    2)IsMatch( "<https://microsoft.com>", "(ht&#124;f)tp(s?)\:\/\/\[0-9a-zA-Z\]([-.\w]\*[0-9a-zA-Z])\*(:(0-9)\*)\*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]\*)?" )  

    //all the format not contains variable

    Here's a doc about regular expression in PowerApps for your reference:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-ismatch

     

    In your situation, I suggest you try in or startswith/endwith function.

    1)in

     

    Filter(tablename,First(Split(TextInput1.Text," ")).Result in fieldname,Last(Split(TextInput1.Text," ")).Result in fieldname)

     

    2)startswith/endwith function.

     

    Filter(tablename,StartsWith(fieldname,First(Split(TextInput1.Text," ")).Result),
     EndWith(fieldname,Last(Split(TextInput1.Text," ")).Result)
     )

     

    // since you enter data in the same textinput, so I suggest you use split function to split it to two parts.

     

     

    Best regards,

     

     

  • AndreasGrosse Profile Picture
    8 on at

    Hello, sorry for my late reply but I had some other topics to do. 

     

    I tried the solution with in and startswith/endwith. It did not work. Might my knowledge is not good enough to implement your ideas to my code. 

    Here the code I entered using the startswith/endwith function. Data are populated to the catalogue but as soon as I put in a search term no results in the catalogue any more.

     

    Here my input. My catalogue is filtered with some toggle buttons as well. 

     

    Filter(Filter(PowerApps;
    StartsWith(Category;First(Split(SearchInput.Text;" ")).Result);
    EndsWith(Category;Last(Split(SearchInput.Text;" ")).Result)
    ;(Type = "Certificate"&&'T Certificate'.Value=true
    Or Type = "Instruction Bulletin"&&'T Instruction Bulletin'.Value=true
    Or Type = "Product Bulletin"&&'T Product Bulletin'.Value=true
    Or Type = "MCS Table"&&'T MCS Table'.Value=true
    Or Type = "Instruction Video"&&'T Video'.Value=true)
    And (Language = "German"&&'T German'.Value=true
    Or Language = "English"&&'T English'.Value=true
    Or Language = "Spanish"&&'T Spanish'.Value=true
    Or Language = "Italian"&&'T Italian'.Value=true
    Or Language = "French"&&'T French'.Value=true))
    ;SearchInput.Text in Title Or SearchInput.Text in AdditionalSearchString Or SearchInput.Text in Category)

     

    Thanks again for support

     

    Regards - Andreas

  • kentb1 Profile Picture
    3 on at

    the 'EndWith' function should be defined as 'EndsWith' for the second option. I had better luck with the first option though thanks for the answer!

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