You may have to pack a lunch for this one -🤣
I have a Gallery that is displaying data that individuals up and down the organizational chart will be viewing.
There is also a Combo Box and RadioControl to facilitate search/filter of the gallery contents.
The data displayed in the Gallery is contained in 'RequestTrackerList' (RequestTrackerListCollection).
Access to the data is based upon the employee's job title, employee name and employee supervisor.
Gallery -
/*Search Box Filter for positions of Driver, Teacher, Maintenance, Security*/
If(UserJobTitleLbl.Text = "Driver" || UserJobTitleLbl.Text = "Teacher" || UserJobTitleLbl.Text = "Maintenance" || UserJobTitleLbl.Text = "Security",
Switch(FilterByCategoryRadioCntrl.Selected.Value,
"Status",
SortByColumns(Filter(RequestTrackerListCollection,Status.Value =
CategorySearchComboBox.Selected.Value),"MeetingDate",SortOrder.Descending),
"Created By",
SortByColumns(Filter(RequestTrackerListCollection,'Created By'.DisplayName =
CategorySearchComboBox.Selected.Value),"MeetingDate",SortOrder.Descending),
"Meeting Subject",
SortByColumns(Filter('Competitor External Meeting Request Tracker','Meeting Subject' =
CategorySearchComboBox.Selected.Value),"MeetingDate",SortOrder.Descending),
/*Default Filter If Search Combo Box IsBlank, for Driver, Teacher, Maintenance, Security*/
If(IsBlank(CategorySearchComboBox.Selected.Value) && UserJobTitleLbl.Text = "Driver" || UserJobTitleLbl.Text = "Teacher" || UserJobTitleLbl.Text = "Maintenance" || UserJobTitleLbl.Text = "Security",
SortByColumns(Filter(RequestTrackerListCollection,
Status.Value = "In Draft" ||
Status.Value = "Pending Approval by Teacher" ||
Status.Value = "Pending Security Approval" ||
Status.Value = "Request for More Information" ||
Status.Value = "Minutes Under Teacher Review" ||
Status.Value = "Minutes Under Security Review" ||
Status.Value = "Meeting Completed-Upload Minutes"),"MeetingDate",SortOrder.Descending),
/*Default Filter for Employee*/
If(IsBlank(CategorySearchComboBox.Selected.Value) && UserJobTitleLbl.Text = "Employee",
SortByColumns(Filter(RequestTrackerListCollection,'Created By'.DisplayName =
User().FullName),"MeetingDate",SortOrder.Descending),
/*Default Filter for Manager and Supervisor; The filter should show all items created by the Manger/Supervisor and ONLY the subordinate employees of the Supervisor/Manager viewing the data*/
If(IsBlank(CategorySearchComboBox.Selected.Value) && "Supervisor" || "Manager" in UserJobTitleLbl.Text && UserFullName.Text <> "Joe Schmoe",/*Joe Schmoe has 'Manager' in his Job Title but I don't want him impacted by this filter)*/
SortByColumns(Filter('Competitor External Meeting Request Tracker',JobTitle6EmailAddress = User().Email && 'Created
By'.DisplayName = User().FullName),"MeetingDate",SortOrder.Descending))))))
The last requirement is there are many other 'job titles' that may view the data.
Each of them should have the same viewing limitations as imposed by the 'Employee' IsBlank filter.
There are far too many other jobs to list, so how would I account for this issue? These others should be
allowed to see only their data (these individuals and the 'employee' do not have access to the search
Combo Box, so they only need a default filter for Combo Box 'IsBlank' condition.