I have a pair of combo boxes set up as filters for a gallery, one to choose a person, and one to choose a month.
The filters work fine for the most part, however if you select an item from the combo box, then re-open it and click the x to remove the selected item, the filters stop working.
I have statements in the filtering formula so that if either is blank, it doesn't use it for the filtering so it's not the formula. I also have a button next to the combo boxes that just resets them both and that works properly and shows all items. So it seems when a user removes the item from the combo box, it does count the combobox.selected value as blank even though these is no selected item.
Any workarounds or settings I've missed?
Solved! Go to Solution.
I think it's not enough to just place AgentInput_1 you need to check Property so in that case IsBlank(AgentInput_1.Selected.Value) same for empty and that need to be done to all controls you try verifying cause you are checking if there is something in selection
try to add to the filleter on top of IsBlank() IsEmpty() and check if that will work or show the code from filter to verified if all is ok with it.
Thanks for the suggestion, I tried adding the IsEmpty() to the formula but it still functions the same. It functions perfectly if I click the "Clear" button I set up, but if you click the x in the combo box it breaks
Here's the code:
If(
//If Agent filter is Blank
Or(IsBlank(AgentInput_1), IsEmpty(AgentInput_1)),
//Then check if month input is blank and if so show all items
If(
Or(IsBlank(MonthInput), IsEmpty(MonthInput)),
Sort(
Distinct(
_EvaluatorRecords,
Date(
Year('Session Date'),
Month('Session Date'),
1
)
),
Result,
Descending
),
//Else, filter the results by the Month filter
Sort(
Filter(
Distinct(
_EvaluatorRecords,
Date(
Year('Session Date'),
Month('Session Date'),
1
)
),
Result = MonthInput.Selected.Value
),
Result,
Descending
)
),
//Else agent filter is not blank, check if month input is blank
If(
Or(IsBlank(MonthInput), IsEmpty(MonthInput)),
//If month filter is blank, filter by only agent filter
Sort(
Distinct(
Filter(
_EvaluatorRecords,
AgentInput_1.Selected.Result in Agent.Email
),
Date(
Year('Session Date'),
Month('Session Date'),
1
)
),
Result,
Descending
),
//Else, filter by both Month filter and Agent Filter
Sort(
Filter(
Distinct(
Filter(
_EvaluatorRecords,
AgentInput_1.Selected.Result in Agent.Email
),
Date(
Year('Session Date'),
Month('Session Date'),
1
)
),
Result = MonthInput.Selected.Value
),
Result,
Descending
)
)
)
I think it's not enough to just place AgentInput_1 you need to check Property so in that case IsBlank(AgentInput_1.Selected.Value) same for empty and that need to be done to all controls you try verifying cause you are checking if there is something in selection
That's done it, thanks!
User | Count |
---|---|
254 | |
106 | |
92 | |
47 | |
37 |