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 / in galley if user is n...
Power Apps
Unanswered

in galley if user is not a manager list only his records and if manager list all record of users under him and his records in the galley

(0) ShareShare
ReportReport
Posted on by 114

i have the records stored in a SharePoint list called LeaveRequest :

GTurkistane_0-1699516393356.png

and users stored in a office364 group.

 

what i want is that myapp gets the sign in user email and check if he is a normal user or a manager in office group, then based on that if he is a manager the gallery will display all records in the SharePoint list that he assigned in as manager and display his records too if he requested a leave but if he is normal user then only display the users records alone

 

Categories:
  • Shaheer Ahmad Profile Picture
    2,194 Moderator on at

    Get User's Role (Manager or Normal User):

     

     

    Office365Users.UserProfile(User().Email)

     

     

    Filter the Gallery Based on User's Role:

     

     

    If(
     Office365Users.UserProfile(User().Email),
     Filter(LeaveRequest, ManagerEmailColumn = User().Email || RequesterEmailColumn = User().Email),
     Filter(LeaveRequest, RequesterEmailColumn = User().Email)
    )

     

     

    Replace {Office365GroupName}, ManagerEmailColumn, and RequesterEmailColumn with the actual values from your setup.

  • GTurkistane Profile Picture
    114 on at

    the code is giving me:

    name isnt valid "isMemberOf" isnt recognized

  • Shaheer Ahmad Profile Picture
    2,194 Moderator on at

    I've updated the code above try if this works....

    Lemme open power apps and i'll try to figure out how to check if a user is in a Office group

  • GTurkistane Profile Picture
    114 on at

    nope it did not, it is telling me that "if" has invalid arguments 

  • Shaheer Ahmad Profile Picture
    2,194 Moderator on at

    where are you writing this code?

     

  • Shaheer Ahmad Profile Picture
    2,194 Moderator on at

    Replace ManagerEmailColumn, and RequesterEmailColumn with the actual column names from your dataset.

  • GTurkistane Profile Picture
    114 on at

    in the item section of a gallery

  • GTurkistane Profile Picture
    114 on at

    do you mean the person column? i do not have an email column in sharepoint, all emails are managed in the tenant environment 

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 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard