cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sammy
Helper IV
Helper IV

Filtering gallery with multiple checkboxes

I am trying to add a basic checkbox filter onto my gallery but I can't seem to get them working together, only seperately.

 

The options within the gallery are: Car, Home, Car and Home.

 

What I want is when you select the Car checkbox, that it shows the Car and Car and Home options. SImilarly when you select the Home checkbox it shows you Home and Car and Home. When both are selected I want every option from my document library to show.

 

Below is my code and screenshots of what I'm getting. You can clearly see in screenshot 1 that when both checkboxes are ticked, none of the Home options are showing (red text).PowerApps1.pngPowerApps2.png

 

SortByColumns(If(CarCheckbox.Value=true, Filter('TRU Only Documents',CarCheckbox.Text in Product.Value),HomeCheckbox.Value=true, Filter('TRU Only Documents',HomeCheckbox.Text in Product.Value)),
"FriendlyName", Ascending)
1 REPLY 1
v-monli-msft
Community Support
Community Support

Hi @Sammy,

 

Try below formula instead:

SortByColumns(If(CarCheckbox.Value=true && HomeCheckbox.Value=false, Filter('TRU Only Documents',CarCheckbox.Text in Product.Value),HomeCheckbox.Value=true && CarCheckbox.Value=false, Filter('TRU Only Documents',HomeCheckbox.Text in Product.Value),CarCheckbox.Value=true && HomeCheckbox.Value=true,'TRU Only Documents'),
"FriendlyName", Ascending)

Regards,

Mona

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

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,294)