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 a Gallery with ...
Power Apps
Answered

Filter a Gallery with buttons and then only show items where field EmployeeEmail is equal to the Email of the current logged on User

(0) ShareShare
ReportReport
Posted on by 379

I have the following scenario:

 

I have a screen with a gallery, on the screen I have 4 buttons that filter on a field in my SharePoint list named Status.

When I only place this code in my gallery: Filter('Leave Requests','EmployeeEmail'= User().Email) then indeed, it only shows the items when the field EmployeeEmail equals the email of the current logged on user.

 

Lorem1960_0-1637160238409.png

 

But since I need to be able to filter on the different values on my field Status, I have updated it with the following code for my Items in my Gallery: 

If(
IsBlank(vFilter),
'Leave Requests',
Filter(
'Leave Requests',
Status=vFilter
)
)

 

The above works just fine but I am seeing all items of all my users.

For my All button I have this code onSelect: UpdateContext({vFilter:Blank()})

For my Pending button I have this code onSelect: UpdateContext({vFilter:"Employee Signed"});

So really I need to change it so that it only shows the items of the current logged on user but I have no idea where exactly I need to change my code. Appreciate any help on this.

 

Cheers!!

 

 

 

 

 

Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Lorem1960 

    You need to combine the two criteria in the Filter...so your Formula would be the following:

    Filter('Leave Requests',
     EmployeeEmail= User().Email &&
     (IsBlank(vFilter) || Status=vFilter)
    )

     

    I hope this is helpful for you.

  • Lorem1960 Profile Picture
    379 on at

    Okay, yes, the combination of the two criteria with the Filter works just fine, thank you for that!!

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard