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 / Filtering gallery base...
Power Apps
Answered

Filtering gallery based on current user

(0) ShareShare
ReportReport
Posted on by 111

Hi, I am having issues filtering my gallery based upon who the current user is. That is, it is not fetching the expected results (or any results at all).

 

My OnStart function is as follows (Which works)

Set(currentUser, User().Email)

 

My nested IF within my Gallery is as follows: 

If(
 currentUser = "email@email.com", Sort(Filter('ListName', BU.Value = "Some BU Name"), Created, SortOrder.Descending),
 currentUser = "Email2@email.com", Sort(Filter('ListName', BU.Value = "Some Other BU Name"), Created, SortOrder.Descending),
 currentUser = "Email3@email.com", Sort(Filter('ListName', BU.Value = "Some Other BU Name"), Created, SortOrder.Descending),
// Else if none of the above conditions are met - do this
 Sort(Filter('ListName', 'Created By'.Email = currentUser), Created, SortOrder.Descending)
)
Problem with AD/Windows, some org emails may be lowercase or upper case. Has anyone got any suggestions about another way to tackle this? 
Categories:
I have the same question (0)
  • Verified answer
    Mike2500 Profile Picture
    1,247 Super User 2024 Season 1 on at

    To deal with the case issue, the standard answer is to convert both to either upper or lower case:

    if(Upper(currentUser) = "EMAIL@EMAIL.COM"....

     

    Or, add that to the app start:

    Set(currentUser, Upper(User().Email))
  • Albertax Profile Picture
    111 on at

    Thanks @Mike2500 , Seems to do the trick

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

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard