cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
twain
Frequent Visitor

Combox only filtering on one value, not all selected values

Simple question here:

 

I have a Combobox that I am using to filter a GalleryGrid tied to a Sharepoint list. I am using a table formula in DefaultSelectedValues that pre-populates the values, and I have tried manually selecting the options. In both cases, no matter what order I put these values in, it only filters on the last value. Visually, I can see multiple options are selected, but it only filters the gallery on one of the values. The combobox obviously has multiple choices enabled…

 

SP list: 'Task Assignments'

Column: 'Leave type'

 

DefaultSelectedItems: Table({Value:”PTO”}, {Value:”LWOP”}) Table({Value:"PTO"}, {Value:"LWOP"},{Value:"Parental Leave"},{Value:"Bereavement"},{Value:"Military Leave"})

Items: Filter(Choices([@'Task Assignments'].'Leave Type'), Value="PTO" || Value= "LWOP"|| Value= "Military Leave" || Value= "Parental Leave" || Value= "Bereavement")

OnSelect: Filter('Task Assignments','Leave Type' in var)

 

I need it to filer on all of these options entered, but as you can see in the Screenshot, it only filters on whatever the last value is. I've tried a bunch of different formulas, but it always sorts on the last value

 

Been pulling my hair out for two months on this

 

Thoughts?

 

8 REPLIES 8
BCBuizer
Super User
Super User

Hi @twain ,

 

Observing that you have 5 selected items in you combobox, there seems nothing wrong with the DefaultSelectedItems property.

 

However, the OnSelect property makes no sense to me as it will accomplish nothing.

 

Can you please share the Items property of your Gallery as I think the issue is in there.

twain
Frequent Visitor

Agreed, the DefaultSelectedItems seem fine

 

Currently the Items is: 

Filter(Choices([@'Task Assignments'].'Leave Type'), Value="PTO" || Value= "LWOP"|| Value= "Military Leave" || Value= "Parental Leave" || Value= "Bereavement")

 

But I've also tried:

 

Choices([@'Task Assignments'].'Leave Type')

Filter([@'Task Assignments'].'Leave Type')

Thank you!

 

items screenshot.PNG

BCBuizer
Super User
Super User

Hi @twain ,

 

You shared the Items property of the ComboBox. Can you please share the Items property of the gallery:

 

BCBuizer_0-1653062538611.png

 

twain
Frequent Visitor

ah! gotcha... here it is:

 

Gallery items.PNG

BCBuizer
Super User
Super User

HI @twain ,

 

So I see you are using a collection. How is that built? I assume it is done in the Onselect property of the the "View Data" button. Can you please share how you build the collections?

twain
Frequent Visitor

Right, with the Onselect property of an invisible button which patches to a Sharpoint list:

Onselect patch.PNG

And the OnSelect of the Gallery grid is: Patch(colGridData,ThisItem,{Title: workItem.Text, Year: Caregory.SelectedItems,’Leave Type’:Progress.Selected,Hours:priority.Selected,’Starte date’: Startdate.SelecctedDate,’End date’:Duedate.SelectedDate,Employee:AssignedTo.Selected})

 

BCBuizer
Super User
Super User

Hi @twain ,

 

Two observations:

 

1. In you post previous to the last I see there are now multiple leave types.

2. There is no filter for leave type in the the code you share in your last post.

twain
Frequent Visitor

Yes, this is a glitch that randomly displays other leave types, but then goes away after a few minutes or if I refresh it a couple times

 

So I need to put a filter in the Onselect of the ClearCol button that builds the collection? I've been trying to add a filter on the text in, but it gives me incompatibility errors with the text fields

Helpful resources

Announcements
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,628)