Thanks - they were blank - no rows coming through. I think then discovered the usersettings weren’t getting updated and saved unless I went into the settings menu view and “clicked” save.
Which leads me to ask a question - when a user logs in for the first time, does the usersettings pick up an initial value expression or do you actually have to go into the setting menu and click “save” to create the record?
I wanted the usersettings to default to values in my “user” table - such as which company they represent and what role they have. I then use this info in the slice row filter to allow:
- any user to see their own data
- any manager representing a company to see all users data from that company
- any user with “Admin” rights to see all data
I also have a filter to only bring up the last 7 days, as well as only “Active” flag lines.
The filter I am using is as below - is this the best way to control my data?
AND([COMPANYLOG]=USERSETTINGS(“Company”) , USERSETTINGS(“Role”) = “Manager”),
To get around this not working i then used lookup() function below - is this suitable?
Seems to work on mobile device fine. My next thought was to setup virtual columns to pull in the user credentials to use in the same expression instead of lookup() function - would that work and is it a better way to handle data?
AND([COMPANYLOG]= LOOKUP(Useremail(),“USERS”,“USER EMAIL”,“COMPANY”), LOOKUP(Useremail(),“USERS”,“USER EMAIL”,“ROLE”) = “MANAGER”),
LOOKUP(Useremail(),“USERS”,“USER EMAIL”,“ROLE”) = “ADMIN”),
Thanks in advance if anyone can give some guidance and apology’s for the long questions.