I have four roles (SuperAdmin, Admin, Student and Coach) where the
Have tried slices and security filters but am missing a piece of the puzzle, Have used the IF(ANY( expression, but to no avail. Any help from the community would be appreciated. Thanks.
Regards,
Jonathan
Hi Marc,
Thanks for the reply. Here is what I have done:
Created a slice called “Current User” and the expression USEREMAIL() = [Email]. [Email] is my first column the Users tab. I have the following roles [Role] - “SuperAdmin”, “CareManager” and “Patient”
Under my “Users” Table with [Email] as my primary key, I input the following formula that you recommended:
IN(INDEX(Current User[Role], 1), list(“SuperAdmin”, “CareManager”, “Patient”))
When I hit save I get the following message: Unable to fetch app definition. Error: Data table ‘Users’ is not accessible due to: Error: Data table ‘Users’ is not accessible due to:
When I remove the expression, the message disappears. I have checked the Google Sheet, regenerated the table.
What I am attempting to achieve is as follows: SuperAdmin sees everything, CareManagers see his/her patients and patients see only their data.
Would appreciate another reply. Thanks.
Regards,
Jonathan
You put that expression where exactly? (screenshots are usually the best)
You can see what error message I am getting.
Not all of it. I’d ask you to post the entire thing, but it is probably better to focus your attention away from that as I don’t think you’rr writing an appropriate expression for your needs to begin with.
Given that you want to specify which records to load under the 4 different role cases, I’d probably use IFS or SWITCH.
Keep in mind that the Security Filter expression is evaluated on every record of the Table. Your posted expression does not reference anything from the Users records, which means it is going to evaluate exactly the same across all records, which is probably not what you want.
Also, your 3 items in the LIST in your expression are different from the 4 roles you mentioned in your first post. That’s confusing.
Sorry about not being clear. So here is the whole story:
So far, the User table has a virtual column called Related Vitals with the experssion (REF_ROWS(“Vitals”, “Email”). The Email in the Profile and Vitals table is a Ref.
Yes, my first post was a generic role setup. Perhaps I am doing something wrong with my columns. Please take a look if you have time. I want to be respectful of your time and expertise.
Oh I think I know what’s going on here. You’re trying to use a Slice in a Security Filter. However, they are based on the same Table, correct (Users)? You can’t do that. The Security Filter requires the Slice to be loaded before it can load any of the Table records, and the Slice needs the Table records to be loaded before it can create the Slice. To get around that you could make another Table just to hold the Roles associated with each USEREMAIL().
Hi Marc,
Thanks for being patient. So I started all over again.
So this part works.
This is what I understand from your previous reply on what I need to do next:
Thanks.
Regards,
Jonathan
User | Count |
---|---|
43 | |
26 | |
24 | |
14 | |
12 |