Good morning all,
I am using the following tutorial to create a role based access to an editable grid app. (Designing A Role-Based User Interface In Power Apps - Matthew Devaney).
But I have hit a wall with the gallery in trying to get it to filter for a specific role. (i.e. Employee, Manager, Administrator)
The current column holding the data for the people is a people picker column in a SharePoint List.
There are [2] connected datasets that are SharePoint Lists.
1. Site Inspections (SharePoint List)
columns:
a. LocationName
b. InspectionStatus
c. InspectedBy (People Picker)
d. InspectionDate
2. Technician Tracking (SharePoint List)
a. User (people Picker)
b. Role
This is the code I am trying to use in the gallery:
If( varRole="Employee", Filter('Site Inspections', InspectedBy.DisplayName=varUser.DisplayName), 'Site Inspections' )
in conjunction with this code to reset the gallery :
Filter('Site Inspections',varReset).
If I remove the { Filter('Site Inspections',varReset) } code and just use the code to filter for role, I can get it to work when I enter the employee email in the OnStart code, but then if I remove the employee email, it stops filtering. When I am in the app as an Admin, it does not filter for my role based on code, which I am guessing is because it specifically says "Employee", so does that mean I have to repeat that line of code for each role?
Sorry for all the questions, and appreciate any help with this.