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 / Free search using a te...
Power Apps
Answered

Free search using a text input

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Say I have a the following data table:
"Pet_Type"    "Pet_Name "    "Owner"
Dog                Buster             Adam

Cat                 Mushroom      Becky

Toucan           Rocko              Chris

 

I'm trying to use one text input line to search on all three columns. I want it so that if I enter to the text input control: "og hri", the data table should display the Dog and Chris rows. Currently I've got a gallery populated by splitting the input text by spaces, like

Split(SearchInput.Text, " ")

Then, I filter the pet table by

Filter('Pets',IsBlank(SearchInput)||Title.Text in Pet_Type||Title.Text in Pet_Name||Title.Text in Owner)

But when I put in "Dog Chris", it behaves very eratically, sometimes only showing the dog row, or chris row, or none at all. Once or twice I just had "Dog" and it showed nothing.

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    If you are just doing a free text search over all the data, then I believe the following formula might be what you are looking for:

    Filter(Pets, 
     (Sum(Split(SearchInput.Text, " "), If(Result in Pet_Type,1))>0) 
     || Sum(Split(SearchInput.Text, " "), If(Result in Pet_Name,1))>0
     || Sum(Split(SearchInput.Text, " "), If(Result in Owner,1))>0
     )

    If you want to tidy it up a bit, you could do something like this as well:

    Filter(AddColumns(Pets, "allData", Pet_Type & " " & Pet_Name & " " & Owner), 
     (Sum(Split(TextInput4.Text, " "), If(Result in allData,1))>0) 
    )

    Or, for even more tidy:

    Filter(AddColumns(Pets, "allData", Concat([Pet_Type, Pet_Name, Owner], Value & " ")), 
     (Sum(Split(TextInput4.Text, " "), If(Result in allData,1))>0) 
    )

    I hope this is helpful for you.

  • v-yuxima-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    Do you test with @RandyHayes 's solution, I test on my side and it works ok. 

    And I will accept it as solution.

    20190514SearchByTextInput1.PNG

     

    Best Regards.

    Yumia

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    This works great, thank you!

  • CU07080701-0 Profile Picture
    on at

    [edit] solved my own problem

    FYI for people trying to use this method, it looks like Result... is no longer supported.

    johnnyshield_0-1684342471361.png

    Replacing Result with ThisRecord.Value seems to work as intended.

    johnnyshield_1-1684342867033.png

    Solved: ThisItem.Result Name isn't valid. "Result" isn't r... - Page 2 - Power Platform Community (microsoft.com)

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 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard