Double LOOKUP()? (Security Filters)

Hello,

Iโ€™m trying to look up the email of the person who is logged in, in the employee table to find out their position (text value). I have that part working fine. What I need next is to use their position to find out what role they are in, based on the role table. That will give me an fk.id that is on a role_level table.

IN(
LOOKUP(
USEREMAIL(),
employee, workAddress_emailAddress, departmentPosition_jobTitle),
LIST(โ€œ1โ€, โ€œ2โ€, โ€œ3โ€, โ€œ4โ€, โ€œ5โ€, โ€œ6โ€)
)

That code will check the position to see if it is in the listed numbers. Unfortunately the positions are a text value, so I need to cross-reference another table to see what the position role is.


Logic Example:

email@email.com โ†’ employee (table)
โ†’ departmentPosition_jobTitle: manager (position)

manager โ†’ role (table)
โ†’ role_level_id (this is an id = to 0-8)

Then LIST() with those 0-8 to give access to a view/form/etc

Solved Solved
0 1 146
1 ACCEPTED SOLUTION

I figured this out. I used a select after the lookup to check if the lookup result was in a list of that select.

IN(
LOOKUP(
USEREMAIL(),
employee, workAddress_emailAddress, departmentPosition_jobTitle),

SELECT(role[departmentPosition_jobTitle],
AND(
IN([departmentPosition_costCenter1], LIST(โ€œINSTALLโ€)),
IN(role_level_[id], LIST(8)))
)
)

View solution in original post

1 REPLY 1

I figured this out. I used a select after the lookup to check if the lookup result was in a list of that select.

IN(
LOOKUP(
USEREMAIL(),
employee, workAddress_emailAddress, departmentPosition_jobTitle),

SELECT(role[departmentPosition_jobTitle],
AND(
IN([departmentPosition_costCenter1], LIST(โ€œINSTALLโ€)),
IN(role_level_[id], LIST(8)))
)
)

Top Labels in this Space