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
Resident Rockstar
Resident Rockstar

@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
Resident Rockstar
Resident Rockstar

@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 Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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