cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rajeey3
Helper I
Helper I

Trouble with filering gallery by ComboBox

I have a gallery of records.

I have a collection of a column in the records. e.g. Department Collection.

 

I would like to filter the gallery, show all if combobox is empty or combobox = "All". 

Or if an item is selected in the combobox then filter the records by it. Going by other posts I am sure I have it correctly set up but it just doesnt seem to work.

 

Here is a tester gallery I am using and the code:

Gallery Code:
Filter(SalaryData, IsBlank(ComboBoxDepFin_Test.SelectedItems.Result) || 'PAMS Dept' in ComboBoxDepFin_Test.SelectedItems.Result)

 

My Collection code and a screenshot of the options:
ClearCollect(DepCollection, {Result: "All Departments"});
Collect(DepCollection, Distinct(SalaryData,'PAMS Dept'));

 

Rajeey3_0-1623060610169.png

I've also put a label and added the combo.selected.result but it seems to retrieve blank even when I am selecting an option.

 

Any one any ideas?

 

Thanks!

 

 

9 REPLIES 9
Krishna_R
Responsive Resident
Responsive Resident

Hey @Rajeey3 ,

 

instead of ComboBoxDepFin_Test.selecteditems.result have you tried ComboBoxDepFin_Test.Selected.Result

zmansuri
Super User
Super User

try Selected.Result instead of selecteditems

@zmansuri @Krishna_R 

 

I changed the code to :

Filter(SalaryData, IsBlank(ComboBoxDepFin_Test.Selected.Result) || 'PAMS Dept' = ComboBoxDepFin_Test.Selected.Result)

Rajeey3_0-1623063564916.png

but as you can see it just doesnt filter? lol

You need to troubleshoot.

take a label and set text property to ComboBox.Selected.Value or  ComboBox.Selected.Result.

See what kind of data you are getting. your result should be 'PAMS Dept'. Only then it will work.

 

Also if 'PAMS Dept' is a choice type colum then you need to write 'PAMS Dept'.Value in filter query.

 

@zmansuri 

 

Yeah ive a label set up for it but also retrieves blank. And when I hover over .selected.result it says = blank in the formula bar.

Strange one when an option has been selected! 

The PAMS dept field is just a text field, collection code is above.

Krishna_R
Responsive Resident
Responsive Resident

Hey @Rajeey3 

 

I hope you've to update like this in the gallery items property

 

If(IsBlank(ComboBoxDepFin_Test.Selected.Result), SalaryData, Filter(SalaryData,'PAMS Dept' = ComboBoxDepFin_Test.Selected.Result))

 

 

Possibly a bug? @Dominik-Winkler 

Dominik-Winkler
New Member

Seems that way. I am having multiple issues with PA for teams Comboboxes myself. And they did not exist before last friday

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (5,234)