cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
radiosonicfan
Advocate V
Advocate V

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

@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.
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
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 (1,451)