cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
crdawson
Helper I
Helper I

Combo Box not clearing properly

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?

1 ACCEPTED SOLUTION

Accepted Solutions
SebS
Memorable Member
Memorable Member

@crdawson 

 

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 


If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.

View solution in original post

4 REPLIES 4
SebS
Memorable Member
Memorable Member

@crdawson 

 

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.


If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.
crdawson
Helper I
Helper I

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

crdawson_0-1669822651114.png

 

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

SebS
Memorable Member
Memorable Member

@crdawson 

 

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 


If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.
crdawson
Helper I
Helper I

That's done it, thanks!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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