cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

Prevent Blanks in ComboBox Selection

 

I am trying to figure out a way to prevent blank cells from showing up in my CB selection as shown here (the series of commas are due to concatenating multiple blank fields  - these are what i am trying to get rid of):

 

combo_with_blanks.JPG

 

Following is what is in ComboBox.Items:

Filter(CollPtAPrd,Value(GrpTot)=Max(CollPtAPrd,GrpTot))

 

Following is the applicable portion of the collection that is being used in the CB above:

ClearCollect(CollPtAPrd,
AddColumns(PtAProd,
     "GrpTot" , 1
   , "GrpLoc" , ""
   , "GrpBrd" , ""

There is a separate filter selection screen that works by incrementing "GrpTot" by one for each filter that is selected so that only those items with the highest 'GrpTot" value are shown in the CB. When multiple filters are selected, everything is fine in the CB. Of course, I would like the user to be able to see all products in the CB if no filters are selected. That is when I am having issues.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Prevent Blanks in ComboBox Selection

Hi @AGS94 ,

Which column do you use as the Display value within your ComboBox?

Do you want to remove the Blank value from your ComboBox?

 

I have made a test on my side, please take a try with the following workaround:

Set the Items property of the ComboBox to following:

 

Filter(
CollPtAPrd,
Value(GrpTot)=Max(CollPtAPrd,GrpTot),
!IsBlank(First(Split(DisplayColumn, ", ")).Result) && !IsBlank(Last(FirstN(Split(DisplayColumn, ", "), 2)).Result) && !IsBlank(Last(Split(DisplayColumn, ", ")).Result)
)

Note: The DisplayName represents the column in your CollPtAPrd collection, which you used as Display value within the ComboBox. I assume that the DisplayName column value is concatenated with three fields value.

 

 

Please take a try with above solution, check if the issue is solved.

 

In addition, if you want to see all products in the CB if no filters are selected, please consider set the OnChange property of the ComboBox to following:

 

If(
   IsBlank(ComboBox1.Selected.Value),
   ClearCollect(                              /* <-- Reset the CollPtAPrd collection */
CollPtAPrd, AddColumns(
PtAProd, "GrpTot" , 1,
"GrpLoc" , "",
"GrpBrd" , ""
) )
)

 

Best regards,

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Prevent Blanks in ComboBox Selection

Hi @AGS94 ,

Which column do you use as the Display value within your ComboBox?

Do you want to remove the Blank value from your ComboBox?

 

I have made a test on my side, please take a try with the following workaround:

Set the Items property of the ComboBox to following:

 

Filter(
CollPtAPrd,
Value(GrpTot)=Max(CollPtAPrd,GrpTot),
!IsBlank(First(Split(DisplayColumn, ", ")).Result) && !IsBlank(Last(FirstN(Split(DisplayColumn, ", "), 2)).Result) && !IsBlank(Last(Split(DisplayColumn, ", ")).Result)
)

Note: The DisplayName represents the column in your CollPtAPrd collection, which you used as Display value within the ComboBox. I assume that the DisplayName column value is concatenated with three fields value.

 

 

Please take a try with above solution, check if the issue is solved.

 

In addition, if you want to see all products in the CB if no filters are selected, please consider set the OnChange property of the ComboBox to following:

 

If(
   IsBlank(ComboBox1.Selected.Value),
   ClearCollect(                              /* <-- Reset the CollPtAPrd collection */
CollPtAPrd, AddColumns(
PtAProd, "GrpTot" , 1,
"GrpLoc" , "",
"GrpBrd" , ""
) )
)

 

Best regards,

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Resolver I
Resolver I

Re: Prevent Blanks in ComboBox Selection

Your assumptions were correct and it worked perfectly - thanks!

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (4,955)