Skip to main content

Notifications

Power Apps - Building 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))

  • Re: Filtering gallery with toggle button

    Thanks ! Let me test and update you if this works

  • Re: Filtering gallery with toggle button

    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

  • Re: Filtering gallery with toggle button

    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)

  • Drrickryp Profile Picture
    Drrickryp on at
    Re: Filtering gallery with toggle button

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

     

     

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,475

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,767

Leaderboard