CONTEXT("ViewType") Does Not Work as Exepected - Long standing BUG

Trying to only show a Table ID field in table view only.

IN(CONTEXT("ViewType"), LIST("Table"))

or

CONTEXT("ViewType") = "Table"

Does not work, the field is blank in the table view!

You have to do the following to get it to work.

NOT(IN(CONTEXT("ViewType"), LIST("Detail", "Form", "Deck")))

(And no. it is not a virtual column as mentioned in the documentation)

Solved Solved
0 9 304
1 ACCEPTED SOLUTION

Thanks for helping me think it through....

I needed to do IN(CONTEXT("ViewType"), LIST("Dashboard", "Table"))

View solution in original post

9 REPLIES 9

Steve
Platinum 4
Platinum 4

Please post a screenshot of the entire app screen demonstrating the problem.

Are you using this is the Desktop Mode preview?

In development mode and browser mode.

No, I meant do you have the Desktop Mode preview turned on (see image).  The reason for asking is because these versions of the Desktop views have known issues with the CONTEXT() functions.

As @Steve suggested, an image with help 10-fold in understanding and getting answers more quickly.

Screenshot 2022-11-08 at 12.50.33 PM.png

Desktop Preview Mode is off (I've never used it)

I am not sure a screenshot is going to help. When I have time, I might try creating a Loom video

Basically the function CONTEXT("ViewType") = "Table" does not work, you have exclude view types instead as in... (Resultant column  in the table view is blank)

NOT(IN(CONTEXT("ViewType"), LIST("Detail", "Form", "Deck"))) so it  shows in the table view but not in the other views. (Resultant column  in the table view is shown as expected)

At least when viewing data in a table view.

I am sure an AppSheet support person could test this and pass on to the developers.

 

We wanted images to see your configuration.  

First some assumptions:

  • [Table ID] is a key column
  • You're placing the expression in the Show_If property of the [Table ID] column

I tested this in my own tester app and do not see an issue.  See images below.  Please let me know where my example differs from yours.

ID values show correctly in Table view

Screenshot 2022-11-08 at 2.35.40 PM.png

ID field correctly does not show in the Detail view

Screenshot 2022-11-08 at 2.36.48 PM.png

Adjusted expression - ID column correctly does not show values

Screenshot 2022-11-08 at 2.39.22 PM.png

Adjusted expression - ID field shows in Detail view

Screenshot 2022-11-08 at 2.41.32 PM.png

Thanks for that.

I will try to post similar screenshots

There must be something different.

One thing my Table view is in a Dashboard.... Mmmm perhaps I need to use Dashboard as well as Table.

Thanks for helping me think it through....

I needed to do IN(CONTEXT("ViewType"), LIST("Dashboard", "Table"))

Actually, I think including "Table" makes no difference. 

There is a flaw with CONTEXT() when using a Dashboard in that you cannot target individual views inside.  They are all considered part of CONTEXT("ViewType") = "Dashboard" with CONTEXT("View") = the  name of the Dashboard.

I created this Feature Idea some time ago.  Please upvote it

https://www.googlecloudcommunity.com/gc/Feature-Ideas/Enhance-CONTEXT-to-allow-access-to-Dashboard-A...

 

Top Labels in this Space