Hello Everyone,
I am new to power apps, I am trying to build an app where a manager can enter notes for his employees. So far, the app is working successfully. I am struck up with creating granular level permissions in the app. Please help me with the following scenario and how to proceed with restricting the managers to only see and edit their location data
I have a table dbo.Manager_Information_Table
Division | Location | Manger Name | |
1 | NJ | dan | |
1 | NJ | jon | |
2 | KY | dan | |
1 | NJ | kim | |
2 | KY | greg | |
3 | TN | greg | |
3 | TN | dan | |
|
|
|
|
I have another table where respective mangers should enter notes for their employee who belongs to their locations and divisions
dbo. Employee_Timesheet_Table
Employeename | Division | Location | TotalHoursworked | Notes by manager |
E1 | 1 | NJ | 8 |
|
E2 | 2 | KY | 2 |
|
E3 | 3 | TN | 1 |
|
E4 | 1 | NJ | 7 |
|
E5 | 2 | KY | 6 |
|
E6 | 1 | NJ | 10 |
|
I am trying to create granular permissions to the mangers. So when they open the app they should be only able to see their employees who belong to their location.
For example: If Manager: Dan opened the app he should be able to see data and edit notes only for his divisions and locations in the gallery as below
Employeename | Division | Location | TotalHoursworked | Notes by manager |
E1 | 1 | NJ | 8 |
|
E2 | 2 | KY | 2 |
|
E4 | 1 | NJ | 7 |
|
E5 | 2 | KY | 6 |
|
E6 | 1 | NJ | 10 |
|
Solved! Go to Solution.
Hi @VenkataSai ,
Do you want filter the Employee_Timesheet_Table based on the current manager?
The solution is: firstly, filter dbo.Manager_Information_Table based on current manager's Email to get this manager's location.
Then filter dbo. Employee_Timesheet_Table based on the locations that you get.
Firstly, you need to connect your app with these two tables.
Then insert a gallery to display the filtered Employee_Timesheet_Table.
Set the gallery's Items to :
Filter(dbo. Employee_Timesheet_Table,
Lacation in
Filter(dbo.Manager_Information_Table,Email=User().Email).Location
)
//you could get current user's email by using formula like this: User().Email
Then the gallery will filter based on current manager. Manager could only view the employees who belong to his location.
Best regards,
OnStart of the App Set a Variable:
If only filter Location
Set(varUserLocation,LookUp(Manager_Information_Table,Email=User().Email,Location));
Set(varUserDivison,LookUp(Manager_Information_Table,Email=User().Email,Division))
On the Gallery items Filter:
Filter(Employee_Timesheet_Table,varUserLocation in Or varUserDivison in Division)
OR
Filter(Employee_Timesheet_Table,Location=varUserLocation Or Division=varUserDivison)
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Hi @VenkataSai ,
Do you want filter the Employee_Timesheet_Table based on the current manager?
The solution is: firstly, filter dbo.Manager_Information_Table based on current manager's Email to get this manager's location.
Then filter dbo. Employee_Timesheet_Table based on the locations that you get.
Firstly, you need to connect your app with these two tables.
Then insert a gallery to display the filtered Employee_Timesheet_Table.
Set the gallery's Items to :
Filter(dbo. Employee_Timesheet_Table,
Lacation in
Filter(dbo.Manager_Information_Table,Email=User().Email).Location
)
//you could get current user's email by using formula like this: User().Email
Then the gallery will filter based on current manager. Manager could only view the employees who belong to his location.
Best regards,
User | Count |
---|---|
174 | |
111 | |
86 | |
44 | |
41 |
User | Count |
---|---|
238 | |
149 | |
132 | |
77 | |
75 |