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

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

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,204)