Skip to main content

Notifications

Community site session details

Community site session details

Session Id : edh3d6Fyi3rAJgNMpjBKR7
Power Apps - Building Power Apps
Unanswered

How to Search Multiple Keywords in a Text Box

Like (0) ShareShare
ReportReport
Posted on 1 Jul 2022 14:28:22 by 57

HELP!!! I am new at this and I am having trouble with one field of my first app.

 

I have a Text Input field that I want users to be able to search multiple keywords at the same time. For example: if a user types Williamson, Travis in the County search box (text input field) I want the results to show all the data cards that contain Williamson and Travis. Right now if you type multiple things like Williamson,Travis or Williamson, Travis or Williamson Travis the gallery goes blank. 

 

This is my gallery formula. If there is a formula that can make the above possible where would I put it (Formulas still confuse me):

Search(Search(Search(Search(Search(Search(Search(Search(Search(TransportationProviders,txtStateFilter.Text,"State"),txtCountyFilter.Text,"County"),txtZipCodeFilter.Text,"ZIP"),txtVendorLookup.Text,"Title"),txtAMBFilter.Text,"Ambulatory"),txtWCVFilter.Text,"WCV"),txtWCVXLFilter.Text,"WCV_XL"),txtTaxiFilter.Text,"Livery_x002f_Taxi"),txtStretcherFilter.Text,"Stretcher_x002f_Gurney")

 

Thank you in advance for any assistance you can provide me with.

 

Categories:
  • WarrenBelz Profile Picture
    146,769 Most Valuable Professional on 05 Jul 2022 at 21:43:05
    Re: How to Search Multiple Keywords in a Text Box

    @amemartinez ,

    The blue line is a Delegation warning as the in filter and Ungroup are not Delegable (neither is Search). If your data source is over 500 records (you can increase this to 2,000), you will only get results from the first 500-2,000 records. You could normally use StartsWith for the filter, but you have the complication of having to split the first values, making it a many-to-many search. You simply cannot do what you are trying on a data set over 2,000 records.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • amemartinez Profile Picture
    57 on 05 Jul 2022 at 16:19:54
    Re: How to Search Multiple Keywords in a Text Box

    So I entered in the above formula but I am getting blue squiggly line under || and nothing is showing up in my data cards now. This is what I entered in:

     

    Ungroup(ForAll(Split(txtCountyFilter.Text,", "),Filter(TransportationProviders,Trim(Result) in txtCountyFilter || Trim(Result) in txtStateFilter || Trim(Result) in Zip || Trim(Result) in txtVendorLookup || Trim(Result) in txtWCVFilter || Trim(Result) in txtWCVXLFilter || Trim(Result) in txtAMBFilter || Trim(Result) in txtStretcherFilter)),"Value")

     

    Then I tried entering exactly what you put and I get a red squiggly line under all of the red text and blue squiggly under all of the blue below:

     

    Ungroup(ForAll(Split(txtCountyFilter.Text,", "),Filter(TransportationProviders,Trim(Result) in County || Trim(Result) in State || Trim(Result) in Zip || Trim(Result) in Vendor Lookup || Trim(Result) in WCV || Trim(Result) in WCVXL || Trim(Result) in AMB || Trim(Result) in Stretcher)),"Value")

     

    What am I missing? 

     

    I want the reps to be able to search some or all of the text boxes at the same time. Sometimes they won't need to do that but other times they will. I want them to be able to enter multiple county names in the County search box if they need to while utilizing the other search boxes as well. Does this make sense?

     

    This is what the filter pane looks like that I made, that I want them to utilize to get the data of what they need:

    amemartinez_0-1657037954874.png

     

  • WarrenBelz Profile Picture
    146,769 Most Valuable Professional on 02 Jul 2022 at 06:00:19
    Re: How to Search Multiple Keywords in a Text Box

    @amemartinez ,

    If you want to search for comma separated values individually, you can do this for one input field, but would have to use the same one for each table field

    Ungroup(
     ForAll(
     Split(
     txtCountyFilter.Text,
     ","
     ),
     Filter(
     TransportationProviders,
     Trim(Result) in County ||
     Trim(Result) in State ||
     Trim(Result) in Zip ||
     . . . . . . . . . .
     )
     ),
     "Value"
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • amemartinez Profile Picture
    57 on 01 Jul 2022 at 15:24:02
    Re: How to Search Multiple Keywords in a Text Box

    I want to be able to just search the County field in the data source, which is one column. So in the CountyFilter text box I want the user to be able to type Wiliamson, Travis and the app would search just the County field for those words and return the records. So the other fields like State, Zip code, Vendor Lookup, etc would be blank and the only box that would have anything in it would be the County box. Does that make sense?

  • WiZey Profile Picture
    3,023 Super User 2025 Season 1 on 01 Jul 2022 at 14:58:21
    Re: How to Search Multiple Keywords in a Text Box

    Hello @amemartinez ,

     

    If I didn't misunderstand, your table look like this:

     

    • State
    • County
    • ZIP
    • Title
    • Ambulatory
    • WCV
    • WCV_XL
    • Livery_x002f_Taxi
    • Stretcher_x002f_Gurney

    You have an input field for each of these columns, and you are trying to get the records whose column's value match with the input's value?

     

    Would a mix-up of "Filter()" and "Split()" work for you?

     

    Filter(TransportationProviders,
     And("State" in Split(txtStateFilter.Text, ","),
     "County" in Split(txtCountyFilter.Text,","),
     "ZIP" in Split(txtZipCodeFilter.Text,","),
     "Title" in Split(txtVendorLookup.Text,","),
     "Ambulatory" in Split(txtAMBFilter.Text,","),
     "WCV" in Split(txtWCVFilter.Text,","),
     "WCV_XL" in Split(txtWCVXLFilter.Text,","),
     "Livery_x002f_Taxi" in Split(txtTaxiFilter.Text,","),
     "Stretcher_x002f_Gurney" in Split(txtStretcherFilter.Text,",")
     )
    )

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,769 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard
Loading started