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.
Solved! Go to Solution.
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.
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.
@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.
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.
Happy to help!! Love beer!! I don't have a link for beer yet, but I do have one in my signature for coffee 😆
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
154 | |
90 | |
67 | |
63 | |
61 |
User | Count |
---|---|
216 | |
159 | |
96 | |
86 | |
79 |