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

---------------------------------------------------------------------------------------------------------------------------


Was I helpful? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. It will help other users to find it faster.

follow me on Twitter @zmansuri123,
connect with me on LinkedIn from Here

@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.

 

---------------------------------------------------------------------------------------------------------------------------


Was I helpful? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. It will help other users to find it faster.

follow me on Twitter @zmansuri123,
connect with me on LinkedIn from Here

@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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (5,489)