web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filtering gallery with...
Power Apps
Unanswered

Filtering gallery with toggle button

(0) ShareShare
ReportReport
Posted on by

Hi, I am looking for help with filtering gallery with 2 toggle buttons . I am able to filter with  1 button  but not able to add second to filter records for a different column. both the columns are yes/No type in same column

This filter works :

If(Toggle1.Checked,Filter(Mycollection,isRegistered='isRegistered (TableName)'.Yes),If(!Toggle1.Checked,Filter(Mycollection,isRegistered='isRegistered (TableName)'.No),Mycollection))

 

I want to add another filter to same gallery now using a diff toggle button and diff column but i am getting error when i use && to combine 2 queries. 

If(Toggle2.Checked,Filter(Mycollection,isAssigned='isAssigned (TableName)'.Yes),If(!Toggle1.Checked,Filter(Mycollection,isAssigned='isAssigned (TableName)'.No),Mycollection))

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @amritat

    With({regfly: Filter(Mycollection,isRegistered='isRegistered (TableName)'.Yes,
     regfln:Filter(Mycollection,isRegistered='isRegistered (TableName)'.No,
     asnfly:Filter(Mycollection,isAssigned='isAssigned (TableName)'.Yes
     asnfln:Filter(Mycollection,isAssigned='isAssigned (TableName)'.No
     option1: Toggle.Checked && Toggle2.Checked
     option2: !Toggle.Checked && Toggle2.Checked
     option3: Toggle.Checked && !Toggle2.Checked
     option4:! Toggle.Checked && !Toggle2.Checked
     },
     If(
     option1, regfly && asnfly, //both toggles checked
     option2, regfln && asnfly, //toggle1 unchecked toggle2 checked
     option3, regfly && asnfln, //toggle1.checked, toggle2 unchecked
     option4, MyCollection // both toggles unchecked
     )
    )

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @amritat  
    If you simply want to filter by both Toggle value (whether it is linked to anything or not)

    Just Use This One on Items Property of Gallery 

    Gallery Items : Filter(Mycollection,isAssigned=Toggle1.Value || isRegistered=Toggle2.Value)

  • AT-07111408-0 Profile Picture
    on at

    This does not work as Isassigned columns has Yes and No i want to show that using Toggle1 button (For example when toggle 1 is checked it should show Yes values and when off it should No values) . 

    I want to do same with Isregistered column ,that coloum also has yes/No . The formula i posted above works for Toggle1 and Isassignec column , i am not able to combine it with Toggle2

  • AT-07111408-0 Profile Picture
    on at

    Thanks ! Let me test and update you if this works

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
wolenberg_ Profile Picture

wolenberg_ 119 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 107 Most Valuable Professional

#3
Haque Profile Picture

Haque 103

Last 30 days Overall leaderboard