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

Filter Gallery by Dropdown and/or Search Box

Good Afternoon, 

 

Im tryng to filter a gallery list i can filter in the seach box its is working good, but also would like to filter by a status in a dropdown??

 

the code im using at the moment is, 

 

SortByColumns(Search('Concierge Tracker', TextSearchBox1.Text, "Account", "Concierge_Specialist", "Vehicle_Reg"), "Date", If(SortDescending1, Descending, Ascending))

 

image.png

 

I would also like to search via a job number? does anyone know how to add this on?? 

4 REPLIES 4
Highlighted
Power Apps
Power Apps

You can combine multiple Search (and Filter) usages in the same expression to search/filter by multiple conditions. For example, to filter by the value of the status shown in the dropbox, in addition to the current search, you could do

SortByColumns(
    Search(
        Filter(
            'Concierge Tracker',
            Status = DropdownStatus1.Selected.Value),
        TextSearchBox1.Text,
        "Account",
        "Concierge_Specialist",
        "Vehicle_Reg"),
    "Date",
    If(SortDescending1, Descending, Ascending))

To search for a job number, in addition to the fields you are already searching on (Account, Concierge_Specialist, Vehicle_Reg), you can pass that additional field to the Search function. That function will search the given text in all of the columns that you passed to it.

Highlighted

That's great Thank you,

 

the job numbers are in a number format though?  you helped me before on this formula before but im unable to get work with both, drop down and search?

 

 

Highlighted

Hi

 

Are you looking for MULTIPLE search functions?

Example:

1. Search by default from PowerApps

2. Search using Dropdown

3. Search using Gallery,...

 

Be default, PowerApps provides:

- SortByColumns(Search(CustomGallerySample, TextSearchBox2.Text, "SampleText"), "SampleText", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending))

 

Rational:

1. ClearCollect all your "Sort & Search results into a Temporay Table, TableX" and list out in Gallery.Items"

2. The way to trigger ClearCollect can be

- OnSelect

- OnChange

- OnVisible,...

 

This is very useful for many scenario. "For me only", this is Simple, Easy to Understand.

You can add more behavior formula such as:

- UpdateContext to clear the TextInput when filter with Dropdown, etc.

 

You can modify this by:

- Screen.OnVisible and a Button, with

Screen,OnVisible = ClearCollect(TableX, TableBrand) &

Button.OnSelect = ClearCollect(TableX, TableBrand)

 

Then, set the

- Gallery.Items = TableX

 

Then, you can have mulltiple search as you wish.

Example:

 

1. Typical TextInput is modified as:

 

TextInput.OnChange & TextInput.OnSelect =

ClearCollect(TableX, SortByColumns(Search(TableBrand, TextSearchBox1.Text, 'Maker', 'Origin'), 'Maker', If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)))

 

2. Dropdown

 

DropDown.OnChange = 

ClearCollect(TableX, SortByColumns(Search(TableBrand, Dropdown1.Selected.Result, 'Brand'), 'Maker', If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)))

or using FILTER, etc. to replace Search or even others.

 

Sample with formulaSample with formulaType USA, or Choose itemsType USA, or Choose itemsClick ALL to show allClick ALL to show all

 

Hope this helps.

Have a nice day.

 

hpkeong
Highlighted
Resolver II
Resolver II

Hello,

 

Seem like i have the same problem with the Dropdown filter, I have Search which is defined from powerapp that works fine.But i have added the new dropdown control from controls to filter the gallery column status. I needed to define two different approches which should not be interlinked to each other, means search should get the values from gallery as one search criteria and where dropdown should work in both ways to gallery like when User any of the one condition below for ex: "All" gallery should show all results and " Approved" only approved status.

 

1. Gallery is called default browsegallery1 ()

2. Status column is fetching the data from sharepoint list as "All","Open", "Pending", "Approved"(This will work when user inputs the data from the normal dropdown list from sharepoint to Powerapps) in powerapps i have defined the for subtitle3 text to "status.value".

3. Now i need to filter the gallery using dropdown when user selects the status accordingly with all other details in the gallery columns.

 

Date Filter:

1. Same goes with the datefilter when user selects startdate and enddate later when user clicks on apply button the gallery suppose to filter the date submitted column.

2. Date column uses the formula as Thisitem.created

 

Thanks in advance!

 

Capture.PNGCapture1.PNGCapture2.PNG

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (9,686)