How to show certain columns depending on the view

Hi, I’m extremely new to appsheet, I started learning it about a week ago.

My Problem: I have a column(Approval) and I have 2 types of users (Writter and Supervisor). In the form I the writter uploads the document and the supervisor reviews the entry and gives approved or rejected status I wanted to show this enum buttons only to supervisor so I used ( IN (USEREMAIL(),Select(user[User Email],[Role]=“Supervisor”))) But this gave me another issue. In the deck view for Writters It has the same column (Approval) as summary, So a writter can quickly see if an entry has been rejected or approved this no longer happens as the above expression prevents anyone other than supervisors from seeing it.

How do I overcome this any help would be much appreciated and please dont go too advanced on me :smiley:

Hello @Thilina, welcome to our community !

Given your use case, you might find it better to limit the edit permissions of the (Approval) column instead of its show permissions, that way your writters will be able to see the approval status of their entries, but won’t be able to change them in any of your views.

This change would mean moving your expression from the show_if to the editable_if fields directly.

2 Likes

Thank you for the quick reply I thought about doing this and was gonna use it as a last resort as I would not be as clean but I’m honestly no expert so I will go with your suggestion.

On a quick side note is there a way to create a virtual column and fill it with whatever the value is in the approval column. My logic being keep show_if as it is and create a virtual column to look up the value of approval column and store it in the virtual column which can be displayed in the summary

Edit: I have done as you suggested but this doesn’t show the buttons greyed out(like my autocompute ID) as I expected but only shows the lable and nothing below it


Thank you for your help

If you’re adamant about this configuration, you could use a more robust expression that would allow you to show your (Approval) field only where it is needed, for example:

IF(CONTEXT("View")="Document_form", IN (USEREMAIL(),Select(user[User Email],[Role]=“Supervisor”)),TRUE)

This expression checks if the user is currently at your document form view, if it is, it then checks if the user is a supervisor, IF the user is a supervisor, then he can see the field, if he’s not, he can’t.

If the user isn’t currently at your “Document_form” view, then it shows it to all users.

The thing with managing only the show_if when trying to limit permissions is that your users won’t be able to see any fields they are not allowed to edit, so it’s often a good idea to mix up edit and see permissions to get the results you’re looking for.

I’m no expert either, this is only my opinion hehe.

Yes, check out this link: Virtual Columns | AppSheet Help Center

You can try setting an initial value for your approval enum, like “pending for approval”, if that fits you, could you share a screenshot of your approval column configuration? it’s the screen that appears once you click the pencil icon next to the column name.

2 Likes

I already did that but for filtering purposes (Separate slice to only show entries that haven’t been looked at)

This issue prevails

I meant the screen that will pop up when you click here:

1 Like

Hope these images have what you are looking for my screen is a small chromebook so i cant get everything in one shot

OK I found a solution in options called Apply Show_if universally under forms section turning this off and reverting back to my old show formula WORKED

but I’ve no idea if there are dire consequences or if it is not best practice can you let me know if there is any issue going with this route?

1 Like

Oh yes, that’s a solution as well, i didn’t think of that .

Well, it won’t let you use show_if parameters outside of your forms, that’s the only consequence, i use show_ifs a lot in my apps outside forms myself, but that depends only on how you’d like to build your app.

1 Like

Can you clarify with a example because I am using show_if in other views normally

PS sorry if I am getting annoying XD

You are? then it is not working as expected, but hey, if it works how you’d like it to, its great.

1 Like