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

Filtering Gallery with Dropdown plus a Combobox

Hi all,

I sort of have this working but not quite right. Focusing on the right pane of my sheet I have a Gallery filtered by both the dropdown (Dropdown_Sup_3) currently showing Lynn River, and a combobox (ComboBox1Custom) currently showing 4 Items. The dropdown is filtering but the combobox is still letting me choose items from other Suppliers. Is the combobox supposed to be filtered by the dropdown?Filter.png

1 ACCEPTED SOLUTION

Accepted Solutions
Corissandageri
Level: Powered On

Re: Filtering Gallery with Dropdown plus a Combobox

Thank you

Filter(Table1,Supplier=Dropdown_Sup_3.Selected.Result)

This part of your code fixed it. 

View solution in original post

6 REPLIES 6
Super User
Super User

Re: Filtering Gallery with Dropdown plus a Combobox

@Corissandageri 

Are you saying that the ComboBox should only be showing 2 items?

 

Please supply the code used in the Items property of the ComboBox.  Is there any column for Vendor in the datasource for this?

EricLott
Level 10

Re: Filtering Gallery with Dropdown plus a Combobox

In the combobox that's showing items from other suppliers, what is the Items property set to? It should be filtered there.

Corissandageri
Level: Powered On

Re: Filtering Gallery with Dropdown plus a Combobox

Yeah, taking a while to understand how to work with combobox.

Dropdown_Sup_3

Items 

Sort(Distinct(Table1,Supplier),Result)

 

ComboBox1Custom

Items

Table1

OnChange 

ClearCollect(Purchaselist1, Gallery4Custom.AllItems)

DisplayFields

["Description02","Supplier"]

Search Fields

["Description02","Supplier"]

 

Gallery4Custom

Items

If(IsEmpty(ComboBox1Custom.SelectedItems) ,Table1 , Filter(Table1,Description02 in ComboBox1Custom.SelectedItems.Description02 && Supplier in Dropdown_Sup_3.Selected.Result))

Super User
Super User

Re: Filtering Gallery with Dropdown plus a Combobox

@Corissandageri 

Would simply re-using the same code from the Items property of your Dropdown work?

Sort(Distinct(Table1,Supplier),Result)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Community Support Team
Community Support Team

Re: Filtering Gallery with Dropdown plus a Combobox

Hi @Corissandageri ,

Do you want the combo box only display the items filtered by the drop down?

If so, Please set the combo box's Items:

Filter(Table1,Supplier=Dropdown_Sup_3.Selected.Result)

Other formulas do not need to modify.

 

 

If you want the combo box display items without duplicate value, try this:

Distinct(Filter(Table1,Supplier=Dropdown_Sup_3.Selected.Result),Distinct).Result

In this situation, the DisplayFields and Search Fields could only set to the column.

DisplayFields

["Result"]

Search Fields

["Result"]

The gallery's Items:

If(IsEmpty(ComboBox1Custom.SelectedItems) ,Table1 , Filter(Table1,Description02 in ComboBox1Custom.SelectedItems.Result && Supplier in Dropdown_Sup_3.Selected.Result))

 

 

 

Best regards,

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

Re: Filtering Gallery with Dropdown plus a Combobox

Thank you

Filter(Table1,Supplier=Dropdown_Sup_3.Selected.Result)

This part of your code fixed it. 

View solution in original post

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,683)