cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bugeater87
Level: Powered On

Multiple filters for gallery items

All: I am working on an asset inventory app and wanting to have multiple filtering options on the main gallery.  The primary database has name, asset tag, SN, etc.  Additionally, there are fields that are linked to other tables.  These included classification, Building location, and status.  All the tables are lists within SharePoint.

 

What I'd like is to have a normal search bar plus a filter using a combination of the 3 linked fields.  The trick being that if a linked field is "All", then there is no filter for that specific field.  I think it would be similar to the sample ticket system but certainly more complicated due to the "All" the table.

 

Hopefully someone has some ideas on how to create the filter/search statement. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Multiple filters for gallery items

Ok, if "All" isn't an actual value in the item in the gallery then try this:

 

Filter([DataSourceName], 
 StartsWith([FieldName], TextSearchBox1.Text),
 dropdown1.selected.Value = "All" Or dropdown1.selected.Value = [FieldName],
 dropdown2.selected.Value = "All" Or dropdown2.selected.Value = [FieldName],
 dropdown3.selected.Value = "All" Or dropdown3.selected.Value = [FieldName]
)


--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
7 REPLIES 7
Community Support Team
Community Support Team

Re: Multiple filters for gallery items

Hi @bugeater87,

 

Could you please explain a bit for the following part:

"

What I'd like is to have a normal search bar plus a filter using a combination of the 3 linked fields.

"

Do you mean you would like to have one SearchBox control , and then use it to search with 3 linked fields?

If here the linked fields means Lookup type field under SharePoint list, then there would be delegation issues included in the filter.

Understand delegation

 

Assuming here Dropdown control is used for those lookup fields, and there is "All" option for those fields, then the logic for it should be as below:

If(Dropdown1.Selected.Value="All",
    If(Dropdown2.Selected.Value="All",
        Table,
         Filter(Table, Field2=Dropdown2.Selected.Value),
    Filter(Table, Field1=Dropdown1.Selected.Value,
                        Field2=Dropdown2.Selected.Value)
      )

For lookup fields, please change field1 as Field1.Value.

It would be much helpful if you could share some data examples.

 

Check to see if this would help in your scenario.

 

Regards,

Michael

 

 

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
bugeater87
Level: Powered On

Re: Multiple filters for gallery items

Here is an image of what I'm working on.

 

As I mentioned, I have a standard search bar at the top so you can search by typing.  Then I'd like to have a couple filters based upon class, status, and location.  These 3 are dropdowns that are based on their own tables.  Within the main table, these fields are setup as a lookup to one of these external tables.

 

I figured the search function and the filter function would have to be independent of each other.  Meaning either I search using the input from the search bar or I use the filter functions and scroll to my desired item but not both at the same time.

 

 

 

AssetInventory

Highlighted
Super User
Super User

Re: Multiple filters for gallery items

You can do both in a Filter. I don't know the details of your data source but it would look something like this:

 

Filter([DataSourceName], 
 StartsWith([FieldName], TextSearchBox1.Text),
 dropdown1.selected.Value = [FieldName],
 dropdown2.selected.Value = [FieldName],
 dropdown3.selected.Value = [FieldName]
)


--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
bugeater87
Level: Powered On

Re: Multiple filters for gallery items

I think that would work except that if dropdown1/2/3 are "All" then that particaular filter would not apply.

Super User
Super User

Re: Multiple filters for gallery items

Ok, if "All" isn't an actual value in the item in the gallery then try this:

 

Filter([DataSourceName], 
 StartsWith([FieldName], TextSearchBox1.Text),
 dropdown1.selected.Value = "All" Or dropdown1.selected.Value = [FieldName],
 dropdown2.selected.Value = "All" Or dropdown2.selected.Value = [FieldName],
 dropdown3.selected.Value = "All" Or dropdown3.selected.Value = [FieldName]
)


--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
bugeater87
Level: Powered On

Re: Multiple filters for gallery items

This works great!  Thanks for the help.

alex3
Level: Powered On

Re: Multiple filters for gallery items

Hi @bugeater87

How were you able to use the All option in the filter dropdowns? I am trying something similar and cant get it to work.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 238 members 4,508 guests
Please welcome our newest community members: