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

Multi ComboBox selection in Canvas APP

Hi PowerApps community, 

 

I've made a canvas app, with a gallery filtered by three combo boxes. The data source is a Collection filled by a Dataverse instance.

The image below, shows the app when i open it the first time. 

Default.jpg

 

This is the ITEMS selection  FX of the gallery. 

 

If(IsBlank(ComboBox1)

&& IsBlank(ComboBox1_1)

&& IsBlank(ComboBox1_2),TempCompetences

 

If(Not(IsBlank(ComboBox1))

&&Not(IsBlank(ComboBox1_1))

&&Not(IsBlank(ComboBox1_2)),

Filter(TempCompetences,Person.Person exactin ComboBox1.SelectedItems.Person,Product.Product exactin ComboBox1_1.SelectedItems.Product,Value.Value exactin ComboBox1_2.SelectedItems.Value),

 

If(Not(IsBlank(ComboBox1))

&&(IsBlank(ComboBox1_1))

&&(IsBlank(ComboBox1_2)),

Filter(TempCompetences,Person.Person exactin ComboBox1.SelectedItems.Person),

 

If(Not(IsBlank(ComboBox1))

&&Not(IsBlank(ComboBox1_1))

&&(IsBlank(ComboBox1_2)),

Filter(TempCompetences,Person.Person exactin ComboBox1.SelectedItems.Person,Product.Product exactin ComboBox1_1.SelectedItems.Product),

 

If(IsBlank(ComboBox1)

&&Not(IsBlank(ComboBox1_1))

&&(IsBlank(ComboBox1_2)),

Filter(TempCompetences,Product.Product exactin ComboBox1_1.SelectedItems.Product),

 

If(IsBlank(ComboBox1)

&&(IsBlank(ComboBox1_1))

&&Not(IsBlank(ComboBox1_2)),

Filter(TempCompetences,Value.Value exactin ComboBox1_2.SelectedItems.Value),

 

If(IsBlank(ComboBox1)

&&Not(IsBlank(ComboBox1_1))

&&Not(IsBlank(ComboBox1_2)),

Filter(TempCompetences,Product.Product exactin ComboBox1_1.SelectedItems.Product,Value.Value exactin ComboBox1_2.SelectedItems.Value))))))))

 

below the image after selection.

after selection.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Below an image after deselection

deselection.png

 

The initial selection works fine, but when i deselected a item, no results are displayed.  What can i do to fix this?

 

All help is appreciated.

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
RandyHayes
Super User
Super User

@FrankEsch 

Please consider changing your Formula to the following:

Filter(TempCompetences,
     (CountRows(ComboBox1.SelectedItems)=0 || Person.Person exactin ComboBox1.SelectedItems.Person) &&
     (CountRows(ComboBox1_1.SelectedItems) =0 || Product.Product exactin ComboBox1_1.SelectedItems.Product) &&
     (CountRows(ComboBox1_2.SelectedItems) =0 || Value.Value exactin ComboBox1_2.SelectedItems.Value)
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Fixed it, I had to put [] in the default Items selection property for each of the comboboxes. 

View solution in original post

6 REPLIES 6
RandyHayes
Super User
Super User

@FrankEsch 

Please consider changing your Formula to the following:

Filter(TempCompetences,
     (CountRows(ComboBox1.SelectedItems)=0 || Person.Person exactin ComboBox1.SelectedItems.Person) &&
     (CountRows(ComboBox1_1.SelectedItems) =0 || Product.Product exactin ComboBox1_1.SelectedItems.Product) &&
     (CountRows(ComboBox1_2.SelectedItems) =0 || Value.Value exactin ComboBox1_2.SelectedItems.Value)
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Awesome, this work's!! Thank you so much. 

I'm sorry,  i have one more question, tried to figure it out by myself, but i can't get it working. If i start the app the first time, now my Gallery is empty, the comboboxes now start's working after i selected an item in each one of them, but not if they are empty or after is select a single item. 

 

 

 

 

RandyHayes
Super User
Super User

@FrankEsch 

You appear to have a value in the one combo...where and why is that getting set?

RandyHayes_0-1616109920715.png

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes ,

 

That is a custom field in my custom value entity/table. It's basically a score to show how good someone is in a certain Competence/Product. This screenshot is taken right after i selected "4", the first time the app starts. I want it to show every record with the value "4". If i would select a value in the other comboboxes, the formula starts behaving as i want, but it works not from the start. I show you a screenshot with the next steps, where i select the other comboboxes and then deselect. 

 

selectedAllComboBoxesAfterStart.pngAfterDeselect.png

Fixed it, I had to put [] in the default Items selection property for each of the comboboxes. 

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (2,093)