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 / how to filter gallery ...
Power Apps
Answered

how to filter gallery using user & his manager details in record

(0) ShareShare
ReportReport
Posted on by

i have gallery with 500 record's

which contains of 80 users with 20 managers details..

i have added user email & manager email column in SP.

now when any user open the screen, only his manager records should be visible.. along with their colleague's who are reporting to his manager.

other manager's details should visible to him.

 

how to i create filter function for this in gallery?

Categories:
  • venky232 Profile Picture
    on at

    sorry typo error in above post

    ***other manager's details should not visible to him.

     

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

    Hi @venky232 :

    You could use this formula to get the current user's manager:

    Filter(
     TheSPList,
     User().Email=emailcolumn
    ).managercolumn

    You could user this formula to get the  current user's manager's Direct Reports:

    Filter(
     TheSPList,
     managercolumn in Filter(TheSPList,User().Email=emailcolumn).managercolumn
    ).emailcolumn

    So the Filter formula should be:

    Filter(
     TheSPList,
     emailcolumn = Filter(TheSPList,User().Email=emailcolumn).managercolumn ||
     emailcolumn in Filter(
     TheSPList,
     managercolumn in Filter(TheSPList,User().Email=emailcolumn).managercolumn
    ).emailcolumn
    )
     

    Additionally, if you already have an org structure relationship in your tenant.

    You could use this formula to get the current user's manager:

    Office365Users.ManagerV2(User().Email).mail

    You could user this formula to get the  current user's manager's Direct Reports:

    Office365Users.DirectReportsV2(Office365Users.ManagerV2(User().Email).mail).value.mail

    So the Filter formula should be:

    Filter(
     TheSPList,
     emailcolumn = Office365Users.ManagerV2(User().Email).mail ||
     emailcolumn in Office365Users.DirectReportsV2(Office365Users.ManagerV2(User().Email).mail).value.mail
    )
     

     Best Regards,

    Bof

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
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard