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:
  • 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard