Does anybody know how I can get a Combo Box to default to all if nothing is selected?
At the moment, I have had to set the DefaultSelectedItems to be all values, as if I leave it blank, the search fails.
This means that if there are particular values that people don't want to search for, they have to deselect them.
I would rather, if possible, have people select the values they want to filter by, and be able to leave it blank if they want to search for everything.
Would greatly appreciate any help. 🙂
Okay, so all of the comboboxes have a table with a single column record called Value with those formulas - and you are specifying all of the choices in your DefaultSelectedItems (DSI) property.
Where is the problem coming from? You state that you set the DSI to none - what does that mean??
So, I cleared the value for the DSI property. This meant that none of the choices were selected by default when I start the app.
The problem, however, was that when I then selected the choices I wanted and clicked Search, it didn't return any results.
Ah, gotcha now. Yes, so the question would be, are you going the be getting rid of the DSI property? The Item formula provided was based on the concept that you would have DSI items.
If you are getting rid of the DSI, then change the formula to the following:
Filter(ListName, (IsBlank(ComboBox2.Selected.Value) || FieldName1 in ComboBox2.SelectedItems.Value) && (IsBlank(ComboBox2_2.Selected.Value) || FieldName2 in ComboBox2_2.SelectedItems.Value) && (IsBlank(ComboBox2_1.Selected.Value) || FieldName3 in ComboBox2_1.SelectedItems.Value) && (IsBlank(ComboBox2_3.Selected.Value) || FieldName4 in ComboBox2_3.SelectedItems.Value) )
The concept is essentially the same. The difference in this case is that we are looking at a singular record - the Selected record. In a multi-select combobox, that record will be only the last selected item. That is really all we need in order to determine if zero items are selected or 1 or more are selected.
I tried inputting the above, made sure there were no errors in it and got rid of the DSI.
I then tried again, selecting a choice from each field and hit Search, but did not get any results back.
You seem to have an extra step in your process that I am not aware of - you are mentioning you are hitting Search...what is that doing?
The formula I had provided was anticipated to be on the Items property of your Gallery.
So, tell me more about this search button.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.