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

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
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

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