different user roles

I would like to ask help, we have user roles client care, user and HR. and we wanted to show only specific columns for the roles. for example for client care we want to show all the columns but limit them from showing amounts like salary and also sensitive data like phone numbers, and addresses. what formula should I use?

Solved Solved
0 4 233
1 ACCEPTED SOLUTION

How you implement this is based on your desired outcome. 

If you have only a single view and wish to hide columns based on the user, the best you can do is hide the data itself, meaning the column headers will still show but the data in each row will be hidden.  (You can use an expression similar to that shown below.  You may need to modify it to use an IN() function where multiple roles can see a column.)

Instead, I recommend creating Role-based views.  Then you can control which columns are shown altogether.  If a user is not supposed to see phone, address and salary, those columns are simply not in the view.  

If the Role-Based views are at the Main view level, then it is simply a matter of inserting a Show If expression into each of the views.  For example, if you have a Manager view, the Show If expression would be something like:

"Manager" = ANY(SELECT(Users[Role], [Email] = USEREMAIL()))

If the Role-Based views are something you navigate to from some row selection, then there will need to be an action (or set of actions) to direct the user to proper view based on their role.  How that is implemented will depend on your current app implementation.

View solution in original post

4 REPLIES 4

First of all, you should read the docs.

I know this may sound rude for some, but really, it's the first thing to do even before any actual app making occurs.

Second, there is no formula/expression to do something without knowing the tables schema.

We can have different approaches to the problem you are asking for help.

Take a look at this post where Matt explains how to get a multi-user support using a slice

Current User (Slice) - How to conform your app aro... - Google Cloud Community

How you implement this is based on your desired outcome. 

If you have only a single view and wish to hide columns based on the user, the best you can do is hide the data itself, meaning the column headers will still show but the data in each row will be hidden.  (You can use an expression similar to that shown below.  You may need to modify it to use an IN() function where multiple roles can see a column.)

Instead, I recommend creating Role-based views.  Then you can control which columns are shown altogether.  If a user is not supposed to see phone, address and salary, those columns are simply not in the view.  

If the Role-Based views are at the Main view level, then it is simply a matter of inserting a Show If expression into each of the views.  For example, if you have a Manager view, the Show If expression would be something like:

"Manager" = ANY(SELECT(Users[Role], [Email] = USEREMAIL()))

If the Role-Based views are something you navigate to from some row selection, then there will need to be an action (or set of actions) to direct the user to proper view based on their role.  How that is implemented will depend on your current app implementation.

Thank you so much! I have actually used that formula the 

"Manager" = ANY(SELECT(Users[Role], [Email] = USEREMAIL()))

I am very new to app sheets and I have minimal knowledge with coding. (i's a young girl learning, please forgive me). 

Can you maybe teach me the formula if I want an admin and a manager role can only view a certain row?

Filtering rows of data is a little different.  You will likely want to create Slices to filter out rows you don't want a user to see.  These act as "custom" tables.  You would use them in views to show only the rows specified by the Slice.

Typically an Admin and Manager would want to see everything so their views would be set to use the base table (not a Slice).

For other users that need to see only limited rows, a Slice is a perfect way to filter out those rows you don't want them to see.  Then you create the View to use this Slice.

I recommend reviewing the below article to learn a little more about Slices:

https://help.appsheet.com/en/articles/895302-slices-the-essentials

 

 

Top Labels in this Space