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 Apps
Answered

Gallery Filter

(0) ShareShare
ReportReport
Posted on by

Hi All,

I am new to power apps and I am currently building a leave request app for use by our team. With the help of searching and youtube I can say I made a lot of progress. Now I am stuck with creating a filter for the Leave Summary page. I can seem to connect the buttons to the gallery itself. I have tried many suggestions but none seem to work or I dont know how to tweak the formulas suggested to work with my data. 

So currently I have this page: 

mao247_1-1712115615847.png

 

 


The gallery items is currently set for the user to view their own entries only and this is the current item formula:
Sort(Filter('Leave requests', 'SME Email' = User().Email), 'Leave Date',SortOrder.Descending)

As you can see, I want to use the buttons to filter based on Approval Status (Item name: Approval).

Need help on how I can have a functioning Filter.

Thanks in advance and I truly appreciate any help.



Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @mao247 ,

     

    You could set the "Pending" button's OnSelect property to:

    Set(FilterStatus,"Pending")

    And then filter the table by this formula:

     

    Sort(Filter('Leave requests', 'SME Email' = User().Email && Status=FilterStatus), 'Leave Date',SortOrder.Descending)

     

    Best Regards,

    Bof

  • mao247 Profile Picture
    on at

    Hi Bof.,

    Thanks for your response. I have tried it but unfortunately got this error

    mao247_0-1712117679988.png



    it says incompatible types for comparison

  • mao247 Profile Picture
    on at

    Thanks @v-bofeng-msft ,

    I figured it out after some tweaking except for the "All" Button. Since I have no approval status option as "ALL", how can I set it so that it either clears the filter or selects all approval statuses?

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @mao247 ,

     

    You could set the FilterStatus's value to all by the reset button

    Set(FilterStatus,"All")

    and then use this formula to do the filter

     

    Sort(Filter('Leave requests', 'SME Email' = User().Email && (FilterStatus="All" || Status=FilterStatus)), 'Leave Date',SortOrder.Descending)

     

    Best Regards,

    Bof

  • mao247 Profile Picture
    on at

    Got it all sorted now @v-bofeng-msft  Thank you so much!

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

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#2
11manish Profile Picture

11manish 205 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard