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

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,603 Super User 2025 Season 2 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

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard