Context("ViewType) - Dashboard

What is the fixed behavior of appsheet in terms of Context("ViewType) ?

For instance, I have a table view. Then place it to Dashboard.

For showif, editif or any other place where we place Context("ViewType) expression, how it should work?

For now, it appears to me Appsheet is just take into account Context("ViewType)=“Dashboard” even it is actually “Table” or any other view tyep, once we place view to Dashboard.

I actually have field which I want to display only on Table view. I also have detail view made out of same table, which is also placed to the same table.

To show this field, I apply Context("ViewType)=“dashboard”, but I m unable to “hide” from detail view on the dashboard…

Hi @tsuji_koichi,

I think all views within the dashboard are treated as “Dashboard” for CONTEXT() purpose.

Workaround could be to omit the column in the corresponding detail view in Detail View --> Column Order options or may be to create a slice only for that detail view without the said column.

Generally I’ve found that context(“VewType”) returns the “top” level of things.

So if, to use your example, you’ve got a dashboard with two tables in it… context(“VewType”) would return “Dashboard”


I’ve run into issues where I’ll try and get clever with context() and only show something sometimes, trying to base that off a view TYPE - only to find that it won’t be showing because the context being returned by the system isn’t what I was expecting all the time.


I’ve found that sometimes it’s better to use:

in(context(“View”), list(
“View 1”,
“View 2”,
etc.
))

and just list all the views you want the specific thing to be shown in - instead of trying to base things off view types. But that only works if you have a few instances where you want something to be seen; if you have a huge list, or want it to be able to change, you’ll have to figure out the context you need.


have you tried:

and(
  context("ViewType") = "Dashboard", 
  context("ViewType") <> "Detail"
)

Perhaps that would sort of “brute force” things to work?

3 Likes

In the same situation as @tsuji_koichi have a column I want in a table of my dashboard but don’t always want in the detail view. Do I have to make a virtual copy for the detail that hides on command? or is there a single column solution for this problem?

Slice

I need to change if they show or dont show though?

I guess I don’t fully understand. You have a table or slice that you want to display in a table view in a dashboard, but you want the table view to omit a particular column. You want the detail view for the same data set to conditionally show or hide that same column. Yes?

I didn’t read through the old thread.

Ya so the table view needs to always show a column and the detail views needs to show column A,B or C depending on another parameter

Is the detail view also displayed in the dashboard?

yes

So paperwork-register is OS, they click the OS type in the table and it shows the other component parts and the OS in the right, all on 1 data source. So I only want the OS that they clicked to show but it has to always show in the table.

As I skim the thread, the gist appears to that yeah, you’ll need a separate column because CONTEXT() isn’t going to give you what you need.