Hello,
I have two views “My Jobs” and “Loads”. How can I do for the app to start with “My Jobs” if the user is a driver and “Loads” if the user is a supervisor.
Thanks in advance for your help!
Solved! Go to Solution.
I assume you’ve got a Users table, and in that table you’ve got two things:
If these conditions are true, then there’s two good ways to handle this:
Either way you can now call data from the specific user’s record and make determinations with it.
Switch(any(current_user[User_Role]),
"Driver", "My Jobs",
"Supervisor", "Loads",
"Some fallback/default view"
)
or
If(
any(current_user[User_Role]) = "Driver", "My Jobs",
If(
any(current_user[User_Role]) = "Supervisor", "Loads",
"Some fallback/default view"
))
or
IFS(
any(current_user[User_Role]) = "Driver", "My Jobs",
any(current_user[User_Role]) = "Supervisor", "Loads"
)
To use the LOOKUP() instead of the Current_User (Slice) just replace the any(current_user[User_Role]) portion of any of the formulas above
IFS(
LOOKUP(USEREMAIL(), Users, User_Email, User_Role) = "Driver", "My Jobs",
LOOKUP(USEREMAIL(), Users, User_Email, User_Role) = "Supervisor", "Loads"
)
Hi @MultiTech_Visions thanks for your response. I’m aware of this setting but I can not find the right expression to make it work.
I assume you’ve got a Users table, and in that table you’ve got two things:
If these conditions are true, then there’s two good ways to handle this:
Either way you can now call data from the specific user’s record and make determinations with it.
Switch(any(current_user[User_Role]),
"Driver", "My Jobs",
"Supervisor", "Loads",
"Some fallback/default view"
)
or
If(
any(current_user[User_Role]) = "Driver", "My Jobs",
If(
any(current_user[User_Role]) = "Supervisor", "Loads",
"Some fallback/default view"
))
or
IFS(
any(current_user[User_Role]) = "Driver", "My Jobs",
any(current_user[User_Role]) = "Supervisor", "Loads"
)
To use the LOOKUP() instead of the Current_User (Slice) just replace the any(current_user[User_Role]) portion of any of the formulas above
IFS(
LOOKUP(USEREMAIL(), Users, User_Email, User_Role) = "Driver", "My Jobs",
LOOKUP(USEREMAIL(), Users, User_Email, User_Role) = "Supervisor", "Loads"
)
It worked!! thanks a lot for that.
You’re welcome
I am working on the exact same thing here.
However I am not returning the starting screen with the view I am trying to associate.
Here are 2 expressions: (Note that User_Role is User_Team for my app)
Switch(any(current_user[User_Team]),
“Admin”, “Repair Needed”,
“Red”, “Takedown Ready: Red Team”,
“Customer Map”
)
If(
any(current_user[User_Team]) = “Admin”, “Repair Needed”,
If(
any(current_user[User_Team]) = “Red”, “Takedown Ready: Red Team”,
“Customer Map”
))
Solving my own problem here:
the “:” in the View name created an issue.
Delete the Colon form the views title fixes the issue.
User | Count |
---|---|
41 | |
27 | |
27 | |
20 | |
13 |