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โ€ฆ

2 12 3,951
12 REPLIES 12

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?

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.

did you solve this problem in some way?

Top Labels in this Space