I wan to add an expression inside a "Are updates allowed?" field.
In particular, I want to enable the changes to all users that have a particular Role (see picture below).
My expression should be something like:
IF(IN(USEREMAIL(), "email of users having a role = "super user"")
How can I convert the second part into an expression based on the structure below?
Here my "user" structure.
LOOKUP(
USEREMAIL(),
"User",
"email",
"Userrole"
)
=
"super user"
Be sure to match the column names to the actual ones in the User table!
@TeeSee1 but the roles are inside another table.. and this table is a Ref inside the user table
Here the expression:
LOOKUP(
USEREMAIL(),
"Users",
"email",
"Related UsersRoles"
)
=
"super user"
and using that expression, I obtain:
Cannot compare List with Text in (ANY(SELECT(Users[Related UsersRoles],([email] = USEREMAIL()))) = "super user")
IN(
"super user",
LOOKUP(
USEREMAIL(),
"Users",
"email",
"Related UsersRoles"
)
)
This will work only if the key column of UsersRoles has text "super user".
It would help to see the whole definition of UsersRoles
([id], [userrole], [ref to user] would be my guess...)
This is the structure of the UsersRoles table:
and then inside the users table I have
IN(
"super user",
SELECT(
USERROLES[Roles],
[Users] = LOOKUP(USEREMAIL(), "users", "email", "user key")
)
)
User | Count |
---|---|
36 | |
31 | |
30 | |
20 | |
17 |