Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Gallery Filter failing to work on Context change

(0) ShareShare
ReportReport
Posted on by 714 Super User 2025 Season 1

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:
  • SpongYe Profile Picture
    5,580 Super User 2025 Season 1 on at
    Re: Gallery Filter failing to work on Context change

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

  • Verified answer
    DCHammer Profile Picture
    714 Super User 2025 Season 1 on at
    Re: Gallery Filter failing to work on Context change

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

  • DCHammer Profile Picture
    714 Super User 2025 Season 1 on at
    Re: Gallery Filter failing to work on Context change

    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.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard