cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
goetz
Frequent Visitor

Filter gallery from dropdown only if toggle true

I have been trying to solve this for a few hours but my knowledge is not enough to crack this.

 

I have a sharepoint list and display it in a Gallery. 

 

I have a Search box, 2 slider and 3 drop downs to filter the Gallery. So far this works fine and as desired.

Filter('Inlay Selector',

DropdownVendor.Selected.Value = Vendor.Value,

DropdownIC.Selected.Value = 'IC Vendor'.Value,

DropdownICFamily.Selected.Value = 'IC Family'.Value,

Slider1.Value >= 'Antenna Width mm',

Slider1_1.Value >= 'Antenna Height mm',

SearchBox.Text in 'Vendor Product Code' Or SearchBox.Text in 'Antenna Width mm')

 

Now I would like to use 3 toggle, so certain filter criteria won't be applied; my intention is to allow the user to disable each of the Dropdowns, so results are not filtered.

 

Filter('Inlay Selector',

If(Toggle2.Value,DropdownVendor.Selected.Value = Vendor.Value),

If(Toggle2_2.Value,DropdownIC.Selected.Value = 'IC Vendor'.Value),

If(Toggle2_1.Value,DropdownICFamily.Selected.Value = 'IC Family'.Value),

Slider1.Value >= 'Antenna Width mm',

Slider1_1.Value >= 'Antenna Height mm',

SearchBox.Text in 'Vendor Product Code' Or SearchBox.Text in 'Antenna Width mm')

 

Is there a good way to do this? What I created doesn't work. If I toggle any of the three toggles off, the gallery is empty.

1 ACCEPTED SOLUTION

Accepted Solutions

So do you want to apply the filter if the toggles are true or if the are false?

 

You can do it without if’s by using or. This should work:

 

Filter('Inlay Selector',

!Toggle2.Value||DropdownVendor.Selected.Value = Vendor.Value,

!Toggle2_2.Value||DropdownIC.Selected.Value = 'IC Vendor'.Value,

!Toggle2_1.Value||DropdownICFamily.Selected.Value = 'IC Family'.Value,

Slider1.Value >= 'Antenna Width mm',

Slider1_1.Value >= 'Antenna Height mm',

SearchBox.Text in 'Vendor Product Code' Or SearchBox.Text in 'Antenna Width mm')

View solution in original post

2 REPLIES 2

So do you want to apply the filter if the toggles are true or if the are false?

 

You can do it without if’s by using or. This should work:

 

Filter('Inlay Selector',

!Toggle2.Value||DropdownVendor.Selected.Value = Vendor.Value,

!Toggle2_2.Value||DropdownIC.Selected.Value = 'IC Vendor'.Value,

!Toggle2_1.Value||DropdownICFamily.Selected.Value = 'IC Family'.Value,

Slider1.Value >= 'Antenna Width mm',

Slider1_1.Value >= 'Antenna Height mm',

SearchBox.Text in 'Vendor Product Code' Or SearchBox.Text in 'Antenna Width mm')

goetz
Frequent Visitor

Genius!!! Thank you so much for your help. You made it look so easy...

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (992)