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

Notifications

Announcements

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 759 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 310 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 228

Last 30 days Overall leaderboard