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
Resolver IV
Resolver IV

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
Resolver IV
Resolver IV

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,148)