Hiding Fields in Certain Views with CONTEXT()

In order to keep my forms as streamlined as possible, I frequently want to automatically population and hide fields - for example, when I’m automatically collecting the users’ email (USEREMAIL()), the current date or time (NOW()), location (HERE()), dereferenced value ([USER].[PHONE]), etc. I hide these fields in order to help users focus just on the essential form fields.

One simple method for controlling whether a field will display in a form or other view types is to use the CONTEXT expression.

image
In Data > Columns fields visibility can be enabled/disabled or controlled via expressions in the ‘Show?’ setting. The CONTEXT() expression can be used to limit which views display each field.

In this case, I’m hiding certain fields in forms:
CONTEXT(“ViewType”) <> “Form”

Any other techniques for limiting when data, views or fields are displayed throughout apps?

3 Likes

I really love the CONTEXT() function and use it very often. Also to show / hide Actions

1 Like

Thank you for posting this.

I have started to use CONTEXT() to change the Column Description based on which view is shown

I place this code in the Display Name of the column I wish to change

Here, I am prompting the user to load a document for the project brief in the DMS (Document Management System) view OR informing the user that the column is displayind a brief overview.

3 Likes