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 / Gallery Filter failing...
Power Apps
Answered

Gallery Filter failing to work on Context change

(0) ShareShare
ReportReport
Posted on by 716 Moderator

Here is the Items property for the Gallery:

Sort(
 Filter('IBC Checklists', Completed = Text(CompFilter)),
 Created,
 SortOrder
)

I have a button on the page for debugging and it changes CompFilter to "true" or "false". I know that works because I also have a label that shows the current context.

I've also included a screenshot that shows that PA understands the context changing. It's "true" in the current image.

DCHammer_0-1697567741300.png

But the gallery doesn't change when I click the button and flip CompFilter back and forth. I was originally comparing Completed = CompFilter directly rather than converting to Text first and that didn't work either.

 

I'm very stumped.

Categories:
I have the same question (0)
  • DCHammer Profile Picture
    716 Moderator on at

    Oh I understand my own problem now. I'm trying to compare Completed (which PA sees as a Boolean because it's a Sharepoint Yes/No column. Now I just need to figure out how to compare.

  • Verified answer
    DCHammer Profile Picture
    716 Moderator on at

    Here is the answer for those following along. You need to convert the text in the CompFilter variable to a Boolean.

     

    Sort(
     Filter('IBC Checklists', Completed = If(CompFilter = "Yes", false, true)
    ),
     Created,
     SortOrder
    )

    Ignore the fact that CompFilter switched from true/false to yes/no. I switched so it was clearer to me which I was setting versus what's in the list.

    Thanks again for attending DC's PowerApps for Dummies. 😄

  • SpongYe Profile Picture
    5,715 Super User 2026 Season 1 on at

    Hi @DCHammer 

     

    You can store a Boolean directly into CompFilter by removeing the dobule quote "".

    So it would look like::

    Set(CompFilter, true);
    UpdateContext({CompFilter: true}); // If you use UpdateContext

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 762

#2
11manish Profile Picture

11manish 640

#3
Valantis Profile Picture

Valantis 548

Last 30 days Overall leaderboard