Need help with expression

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.

0 4 221
4 REPLIES 4

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.

Top Labels in this Space