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

Filter Gallery Issue

(1) ShareShare
ReportReport
Posted on by 87
Hi all,
 
I have a gallery that I want to filter by the user that created the items, and the status value that was clicked on the buttons shown. Currently, I have that working, but I want to show all items or show all items with the "Pending" status by default. How do I update my gallery filter for that? 
 
The items filter for my gallery: 
Sort(Filter(ListeningCenterDG, 'Created By'.Email=User().Email && FilterValue = Status.Value ),Created,SortOrder.Descending)
 
The OnSelect code for the context on each button: 
UpdateContext({FilterValue: "Pending"})
 
Categories:
I have the same question (0)
  • Verified answer
    Kalathiya Profile Picture
    2,456 Super User 2026 Season 1 on at
    Hello @bwebmasta
     
    Just add this to the Screen’s Visible property. That way, whenever you redirect to this screen, the value will be filled automatically.
    UpdateContext({FilterValue: "Pending"});
    Filter Code: 
    Sort(
        Filter(
            ListeningCenterDG,
            'Created By'.Email = User().Email &&
             Status.Value = FilterValue
        ),
        Created,
        SortOrder.Descending
    )
    
    Hope that helps!
     
     
    If this response resolves your issue, please mark it as the Verified Answer so it can help other community members as well.
    ---------------------------------------------------------------------------------
     
    📩 Need more help? Mention @Kalathiya anytime!
    ✔️ Don’t forget to Accept as Solution if this guidance worked for you.
    💛 Your Like motivates me to keep helping!
  • bwebmasta Profile Picture
    87 on at
    Hey @Kalathiya, that works for the pending!  If I wanted to display all items by default, how to adjust for that?  What I tried has given me errors thus far. 
  • Verified answer
    Kalathiya Profile Picture
    2,456 Super User 2026 Season 1 on at
    Hello @bwebmasta
     
    Please update below code: 
     
    Just add this to the Screen’s Visible property.
    UpdateContext({FilterValue: Blank()});
    
     
    Update Filter Code: 
     
    Item Property
    Sort(
        Filter(
            ListeningCenterDG,
            'Created By'.Email = User().Email &&
             (IsBlank(FilterValue) || Status.Value = FilterValue)
        ),
        Created,
        SortOrder.Descending
    )
    Now, by default it will show all the items. 
     
    If this response resolves your issue, please mark it as the Verified Answer so it can help other community members as well.
     
  • bwebmasta Profile Picture
    87 on at
    @Kalathiya Thank you!  I was missing that part with the context. I also created an "All" button in case users want to reset back to all. 
  • Kalathiya Profile Picture
    2,456 Super User 2026 Season 1 on at
    Hello @bwebmasta
     
    Updated Code: 
    Sort(
        Filter(
            ListeningCenterDG,
            'Created By'.Email = User().Email &&
             (IsBlank(FilterValue) || Status.Value = FilterValue || FilterValue = "All")
        ),
        Created,
        SortOrder.Descending
    )
    If this response resolves your issue, please mark it as the Verified Answer so it can help other community members as well.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard