cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
radiosonicfan
Kudo Commander
Kudo Commander

ComboBox Help with Multiple SelectedItems and Gallery

Hello, I am having trouble filtering multiple selected items from a ComboBox in a Gallery.
Right now using a dropdown; however, prefer to switch to a ComboBox and allow Multiple SelectedItems.
Have created a ComboBox with Items; say ComboBox is named "RatingComboBox"

How could I change the bolded section to utilize the ComboBox?
Multiple Selections Set to true.

For instruction purposes, I reduced the length of full gallery formula.
Simply trying to wrap head around the slightly more complicated ComboBox.

SortByColumns(Filter(DataSource, DateColumn2 = Blank() && StartsWith(Region, RegionDropdown.Selected.Value) && StartsWith(Program, ProgramSearchBox.Text) && (Rating.Value = RatingDropdown.Selected.Value))),"DateColumn1")

Thanks for any help.

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@radiosonicfan 

Well, the reason I mentioned the delegation is that the operator is not delegable, but the rest of the formula is.

So, changing your formula to the following will get you past that:

SortByColumns(
    With({_items:
        Filter(DataSource, 
            DateColumn2 = Blank() && 
            StartsWith(Region, RegionDropdown.Selected.Value) && 
            StartsWith(Program, ProgramSearchBox.Text)
        )
        },
        Filter(_items, Rating.Value in RatingDropdown.SelectedItems.Value)
    ),
    "DateColumn1"
)

In this case we prefilter with delegable operators and store that in a scoped With variable called _items.  At this point, you are now working with a memory based internal variable table and there is no delegation issue with internal tables.

So, the in operator in the next Filter will not have delegation issues as it is Filtering the prefilter _items table.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

5 REPLIES 5
RandyHayes
Super User
Super User

@radiosonicfan 

Please consider changing your Formula to the following:

SortByColumns(
    Filter(DataSource, 
        DateColumn2 = Blank() && 
        StartsWith(Region, RegionDropdown.Selected.Value) && 
        StartsWith(Program, ProgramSearchBox.Text) && 
        Rating.Value in RatingDropdown.SelectedItems.Value
    ),
    "DateColumn1"
)

 

Keep in mind that the above operator (in) is not delegable, so if your list will exceed record limits, this will not work properly for you.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 
Thanks for reaching out. Going to have to avoid this action due to delegation. In a few years I will tick past delegation limits. Going to stick with current formula. Delegation is a cruel. 

RandyHayes
Super User
Super User

@radiosonicfan 

Well, the reason I mentioned the delegation is that the operator is not delegable, but the rest of the formula is.

So, changing your formula to the following will get you past that:

SortByColumns(
    With({_items:
        Filter(DataSource, 
            DateColumn2 = Blank() && 
            StartsWith(Region, RegionDropdown.Selected.Value) && 
            StartsWith(Program, ProgramSearchBox.Text)
        )
        },
        Filter(_items, Rating.Value in RatingDropdown.SelectedItems.Value)
    ),
    "DateColumn1"
)

In this case we prefilter with delegable operators and store that in a scoped With variable called _items.  At this point, you are now working with a memory based internal variable table and there is no delegation issue with internal tables.

So, the in operator in the next Filter will not have delegation issues as it is Filtering the prefilter _items table.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes Thank you for your genius. I owe you beer. 

RandyHayes
Super User
Super User

@radiosonicfan 

Happy to help!!  Love beer!!  I don't have a link for beer yet, but I do have one in my signature for coffee 😆

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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