There are employees in our database and they all have different โrolesโ which are predefined by the admin - me.
I have created an expression from a slice from the main employee sheet that filters out all but the current user, to โlogโ the role of an employee when he/she logs in. Its any(Profile slice[Role]).
Now thereโs an action within the employee profile, named Employee Expenses which takes a seeker to the expense table of the concerned employee.
I want that action to be available to Admins, moderators and managers, and managers should not be able to view the action when the concerned person is an Admin or moderator.
I have written the following expression:
or(
and(any(Profile slice[Role])=โManagerโ, and([_THISROW].[Role]<>โAdminโ, [_THISROW].[Role]<>โModeratorโ)),
any(Profile slice[Role])=โModeratorโ,
any(Profile slice[Role])=โAdminโ
)
But the action is showing up for every employee, when the reviewer is a โManagerโ, regardless of his/her position in the company hierarchy. I cannot figure out whatโs wrong.
It seems to be a problem with the [_THISROW].[Role] expression.
Got it. Didnโt need the [_THISROW]. before [Role]. Just using [Role] sufficed.
But this is the โto make it work, do how it worksโ scenario, I can not figure out why [_THISROW] doesnโt work here. I hope someone would explain.
I suspect it doesnโt work as you intend, if you do more testing.
Unless the Employee Expenses table itself has a Role column?
It did have. Yes.
User | Count |
---|---|
35 | |
30 | |
30 | |
20 | |
18 |