cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SachS
Helper II
Helper II

Filter a gallery by drop down or combo box, but with an 'ALL' option

I have a simple app with a gallery showing a list of assets (base is a SP list using the default 'assets' template). One of the columns in the list is 'AssetType' (=Smartphone, Laptop, Printer, Accessory).

 

I would like to give the user the ability to filter the list by AssetType. So far, I've done the following using a combo box:

 

ComboBox items

items = Choices('Asset Manager'.'Asset type')

 

Gallery items

items = Filter('Asset Manager', 'Asset type'.Value = ComboBox3.Selected.Value)

 

This works fine, and the gallery changes based on drop down selection. But the obvious issue is that when no items is selected, the gallery too will show no items. Is there a way to either:

  • Add an 'ALL' item to the combo box so that when it's selected the gallery will show all items.
  • Or, when no item is selected in the combo box, the gallery will show all items.

Is either of those a possibility?

 

1 ACCEPTED SOLUTION

Accepted Solutions
PowerRanger
Super User
Super User

@SachS 

Use this for Gallery items

Filter(
    'Asset Manager',
    'Asset type'.Value = ComboBox3.Selected.Value || IsBlank(ComboBox3.Selected.Value)
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.




​Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item.

If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

1 REPLY 1
PowerRanger
Super User
Super User

@SachS 

Use this for Gallery items

Filter(
    'Asset Manager',
    'Asset type'.Value = ComboBox3.Selected.Value || IsBlank(ComboBox3.Selected.Value)
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.




​Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item.

If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,507)