cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Multiple Filters

I have trying to add drop down boxs to filter gallery data.  I have 10 filters.  It relates to vehicles, I want users to be able to select Make and then model and so on.  I do not want the selections to be dependent on each other, for eample users might want to see how many of the makes are have a manual or auto gear box.

 

I have entered the following into the drop down boxes, changing the search referenece for each one of the 10 seach areas. 

 

SortByColumns(Distinct(Table1_1, MAKE), "Result").

 

What I can't figure out is what formula to put in the gallery to make these drop down boxes work.

 

Thx

8 REPLIES 8
Meneghino
Level 10

Re: Multiple Filters

Hi @Anonymous

 

You need to modify the Items property of the gallery.

This needs to be something like this:

 

Filter(Table1_1, Make=DropdownMake.Selected.Result, Model=DropdownModel.Selected.Result, etc. etc.)

 

Where you need to use the actual names of your controls (i.e. dropdowns)

 

Please let me know how you get on.

 

As soon as you do this you will realise that you have no way to deselect an option (i.e. show all cars of a particular make, either manual or automatic).  For this you need the ability to disable a dropdown.  This can be done, and there should be a few posts on this in the forum.  If not, please come back)

Anonymous
Not applicable

Re: Multiple Filters

Thx for your help.

 

Entered as instructed.  My gallery went blank.  When I tried it just with Make:

 

Filter(Table1_1, Make=DropdownMake.Selected.Result) and not MODL it does filter on Make.

 

Drop down settings.

I have ON CHNAGE set to UpdateContext({variable2: DropdownMODL.Selected.Value})

and Item 

and ITEM set to SortByColumns(Distinct(Table1_1, MODL), "Result")

 

Same as MAKE.

 

Model is actually labelled as MODL on my data source 

Meneghino
Level 10

Re: Multiple Filters

Hi @Anonymous

 

In PowerApps there is no longer the need to use the OnChange for Dropdowns, unless you want something special.  All data that depends on the selected Item is updated automatically.

 

All you need is to correctly set the Items property of the gallery.

 

Also, please remember that PowerApps is case sensitive, so Make is not the same as MAKE.

 

In any case, to find out where the error is you can do the following:

1) Try to set the Items property of the gallery to:

Filter(Table1_1, MAKE="Ford")

2) Create a label anywhere on the screen outside the gallery and set its Text property to:

DropdownMake.Selected.Result

and then see it change as you change the selection in the dropdown, without the need for any OnChange action

 

Once the above two work, then you can set the correct syntax in the Items property.

 

Please let me know.

Anonymous
Not applicable

Re: Multiple Filters

I have taken out all the on change instructions and the make filter stills works.  Still getting a blank screen when I try to add MODL.

 

Filter(Table1_1, Make=DropdownMake.Selected.Result, MODL=DropdownMODL.Selected.Result)

 

The strange thing is when I loaded up the app before I took out on chnage instructions the app started filtering by MODL.  It was not doing it on the creating page.  Went back into app after I saved it and it stopped doing it.

 

When the MODL filter was functioning it brought up all model from all makes rather than just for the make selected in the first dropdown.  Is there a way of changing this?

 

Thx, sorry for all the questions. I am new to this but am so close to creating and app that will change the way our department operates 

nickduxfield
Level 8

Re: Multiple Filters

Filter(Table1_1, Make=DropdownMake.Selected.Result, Model=DropdownModel.Selected.Result, etc. etc.)

 try || in place of the ,

Nikhil2
Level 8

Re: Multiple Filters

Hello,

 

Could anyone help me on this issue, Below is the powerapp which i am using to filter the gallery(documents) from the sharepoint library.

 

I have tried with many filter possibilites but it works either ways but i am looking for 2 sort of filters at a same time and also to download the multiple documents using checkbox. Before filtering user should be able to all the documents. Then as per filter the gallery should work.Capture11.PNGCapture12.PNG

 

1. Is it possible to filter the gallery by selecting values from the dropdown individually, For Ex: if i select training level and as a option "anything", i need to see or filter only training level documents which was defined in the sharepoint doc library and same way goes to all the dropdown Independent or as a one by one. Well i am using Distinct(Table,Column name) for the all the drop downs to fetch the values. The more the filter goes, the gallery should start with filter dynamically.

 

2. Second approch, If i set values to all the dropdowns according to the selection i need see the results in the gallery.

 

3. There is a displaymode set to the below 3 dropdowns, i have value in training level when i select "-" other two dropdowns will be invalid.

 

To Add on, For example:

 

4. This has to work like actual filter, When i select Training level "-" the result should pop up in gallery and show all documents which there under "-". And when actual filter applies to all the dropdowns it should provide the result.

5. And when i select Training level "-" and Application "Any Option" it should filter matching the variables and it should keep filtering accordingly. As many as filter if i apply it should provide the matching documents.

6. On Items for gallery, like i said it works either ways(since i am using "And"/"Or"). So it is either working for "And" otherwise "Or " Sort(Filter('Test Document',And(Training_x0020_Level=Dropdown1.Selected.Value,Application.Value=Dropdown2.Selected.Value,Package.Value=Dropdown3.Selected.Value,Language.Value=Dropdown4.Selected.Value,Medium.Value=Dropdown5.Selected.Value)),Modified,Descending). In my case it should work for both

NikoClau
Level: Powered On

Re: Multiple Filters

I have the same issues. Did you find a solution?

Nikhil2
Level 8

Re: Multiple Filters

Hello NikoClau,

 

What is the issue, can you brief on the problem? if the problem is the same for the multiple filters.

 

I would recommend to use the below code.

 

Filter(Datasource, if(isblank(dropdown.selected.value),true, columnname=dropdown.selected.value) && if(isblank(dropdown1.selected.value),true, columnname=dropdown1.selected.value))

 

This helps you to filter multiple dropdowns at the same time, if nothing is selected(blank) all your outputs will be returned.

 

Let me know if this works.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,833)