cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

SearchTextBox with Multiple criteria

I have a table called "Movements", with two columns - "Name" and "Location"

NameLocation
JayTasmania
KaySydney

 

I have created a textbox to use as a search box, named "FilterTextBox"
below is the function I used to search for the "Name" in the Gallery

Georgetown15x_0-1600834466067.png

How do I incorporate "Location" into the function? so that I can also search for both name and location.

Your insights and solution are much appreciated. 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft
Microsoft

Re: SearchTextBox with Multiple criteria

Hi@Georgetown15x,

Based on the issue that you mentioned, do you want to search two columns within a Search box?

Could you please share a bit more about the scenario, do you want to search and dispaly the filtering result within a Gallery?

Combine that with your description, you want to sort the 'Name' column based on the searched result if there is something with the TextSearchBox and you want to sort the 'Name' column within the data source if there is nothing within the TextSearchBox.

I think that the Search() function could achieve your needs. There is something syntax wrong with your formula.

I have a test on my side, please take a try as below.

Set the Items property of the Gallery as following:

 

Sort(
    If(
        IsBlank(FilterTextBox.Text),
        Movements,
        Search(
            Movements,
            FilterTextBox.Text,
            "Location",
            "Name"
        )
    ),
    "Name"
)

 

Best Regards,

Qi

 

View solution in original post

3 REPLIES 3
Highlighted
Helper I
Helper I

Re: SearchTextBox with Multiple criteria

Someone please help?

Highlighted
Helper I
Helper I

Re: SearchTextBox with Multiple criteria

@PaulD1  could you please help?

Highlighted
Microsoft
Microsoft

Re: SearchTextBox with Multiple criteria

Hi@Georgetown15x,

Based on the issue that you mentioned, do you want to search two columns within a Search box?

Could you please share a bit more about the scenario, do you want to search and dispaly the filtering result within a Gallery?

Combine that with your description, you want to sort the 'Name' column based on the searched result if there is something with the TextSearchBox and you want to sort the 'Name' column within the data source if there is nothing within the TextSearchBox.

I think that the Search() function could achieve your needs. There is something syntax wrong with your formula.

I have a test on my side, please take a try as below.

Set the Items property of the Gallery as following:

 

Sort(
    If(
        IsBlank(FilterTextBox.Text),
        Movements,
        Search(
            Movements,
            FilterTextBox.Text,
            "Location",
            "Name"
        )
    ),
    "Name"
)

 

Best Regards,

Qi

 

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,108)