CONTEXT()

Information about the running app

Returns contextual information about the running app based on the keyword option specified.

Get started

Watch this video to get started using CONTEXT().

Context()

Sample usage

IN(CONTEXT("View"), LIST("Orders_Detail", "Orders_Form")) returns a Yes/No value that answers the question, is the currently-displayed view named Orders_Detail or Orders_Form? This might be used in a Show_If column constraint to display a column only in specific views but hide it elsewhere. See also: IN(), LIST()

SWITCH(CONTEXT("Host"), "Device", "Tap below to:", "Browser", "Click below to:", "") returns different directions depending on whether the app is running from the native app on a device or from a browser. This might be used to generate a display name for a gallery view of launchers. See also: SWITCH()

CONTEXT("VIEWTYPE")="Detail" returns Yes if the current view is of type Detail.

Syntax

CONTEXT(option)

  • option - Must be set to one of the following keywords: AppName, Device, Host, OwnerEmailTableView, or ViewType.

Note: If an invalid option is provided, a null value is returned.

The following describes the contextual information that is returned based on the keyword that you specify:

  • AppName - Unique name of the app, including account ID, as used in app URLs. For example, MyApp-123456.
  • Device - Universally unique identifier (UUID) of the device, intended to identify the mobile device running the native app. Used from a browser, the UUID is tied to the browser's local storage, not the device itself, and may change if the browser's cache is cleared. In the emulator of the app editor, the text expression-assistant-device-id is returned.
  • Host - Returns Browser if the app is running in a browser or the app editor's emulator, Device if a native app, or Server if used from an AppSheet server (for example, in an automation).
  • OwnerEmail - Email of the app owner.
  • Table - Name of the table used by the current view.
  • View: Name of the view currently displayed to the user, or blank if no view is currently displayed (for example, in an automation).
  • ViewType: Type of the view currently displayed to the user, or blank if no view is currently displayed (for example, in an automation). For a list of valid view types, see View types.

Notes

The View and ViewType options are:

In each case, the server is unaware of the view currently visible to the user, so cannot provide the view name or type.

See also

HERE()

NOW()

USEREMAIL()

USERLOCALE()

USERNAME()

USERROLE()

Was this helpful?

How can we improve it?

Need more help?

Try these next steps:

true
Search
Clear search
Close search
Google apps
Main menu
7630791401606542471
true
Search Help Center
true
true
true
false
false