web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to Create Admin an...
Power Apps
Answered

How to Create Admin and User View in Gallery

(0) ShareShare
ReportReport
Posted on by 52

Hi,Everyone 

                 Please Help me with this situation I am new to powerapps I have a sharepoint list named LeaveForms In sharepoint list I have these Columns Employee Name(Person or group); Employee Id(Single line of text); Leave Duration(Choice);  Reason(Multiple lines of text). In one Screen I want to Display Edit Form that perfectly Working.

 

In another Screen is Gallery Screen .In this I want to Display the items in Single gallery View for below situation:

 1.User Only able  to view his items 

2.Admin able to view all items 

How to filter items based on above condition for filtering items in sharepoint list and display to gallery . Please help

 

Thanks and Regards

Aldous

Categories:
I have the same question (0)
  • Verified answer
    AlexLe256 Profile Picture
    47 on at

    Hello @Aldous345 , 

    You can change the datasource of the gallery by this formula:

     

    If(LookUp(sharepointlist,EmployeeName =User().FullName).Role="admin",sharepointlist,Filter(sharepointList,EmployeeName =User().FullName)).

  • Verified answer
    SantoshSarnobat Profile Picture
    30 on at

    Hello @Aldous345 , Not sure if you already have admins defined in AD or SharePoint. 

    You can create a SharePoint list "ConfigList" to manage list of admins and similar stuff. This list will only have Users column(Person or group) and create entry as title = Admin and Users= user1@mail.com .

     

    Now, we can query this list in PowerApps to check if current logged in user is admin or non-admin user and populate gallery items accordingly similar to what @AlexLe256 has suggested. 

    Set items property of gallery control 
    =If(LookUp('ConfigList',Title = "Admin" && User().Email in People.Email), LeaveForms, Filter(LeaveForms, 'Employee Name'.Email=User().Email))

     

    This solution will help you to achive desired result for your usecase. 

     

    Feel free to ask questions if you have any queries with this solution. 

  • Aldous345 Profile Picture
    52 on at

    Thank you @AlexLe256 

  • Aldous345 Profile Picture
    52 on at

    Thank you Its worked @SantoshSarnobat 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard