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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (2,690)