Skip to content

Runtime Variables โ€‹

The runtime layer combines session context, form metadata, registry values, and temporary state for the active form. Everything hangs off the $. root and is reached with a direct path โ€” for example $.self.name or $.variable.companyName.

Namespaces โ€‹

NamespaceHoldsReached with
$.selfThe logged-in user's profile$.self.email
$.formMetadata about the current form$.form.name
$.stateTemporary, script-set runtime state$.state.ticketTitle
$.variableData variables from the registry$.variable.companyName
$.imageImage variables from the registry$.image.logo_h
$.fnCallable functions from the registry$.fn.estimateTurnaround(โ€ฆ)

For where each namespace can be used, whether it is writable, and how it persists, see Variable Reference.

Session context โ€” $.self โ€‹

Read-only values from the logged-in user's profile. Available in all contexts.

VariableTypeExampleDescription
$.self.idstring698f282f7fa272fac96bcb65User unique identifier
$.self.namestringSeanFirst name
$.self.surnamestringDavisLast name
$.self.fullNamestringSean DavisFull name
$.self.emailstringsean.davis@example.comEmail address
$.self.loginstringdavissUsername / login ID
$.self.rolestringadminRole
$.self.themestringโ€”Active theme ID
$.self.languagestringenLanguage preference
$.self.timezonestringAmerica/New_YorkTimezone preference

Runtime state โ€” $.state โ€‹

Form-scoped state set by scripts at runtime. Use it for derived values such as ticket titles and turnaround labels. State lives in memory only and is cleared on page refresh โ€” it is never submitted or persisted.

FunctionReturnsDescription
$state(name, value)anySet runtime state and return the written value. Exposed afterwards as $.state.name. Scripts only
$state(name)anyRead runtime state. Returns undefined if not set
js
// In an On Load script: seed state from session + registry values
$state('ticketTitle', $.variable.companyName + ' / ' + $.form.name);
$state('openedBy', $.self.fullName);

// Anywhere afterwards (label, default, text, rule):
// $.state.ticketTitle
// $.state.openedBy

Syntax reference โ€‹

ContextSyntaxNotes
Data access$.self.nameDirect lookups resolve in text, scripts, defaults, and labels
Form metadata$.form.nameCurrent form id, name, url, mode, and related metadata
Runtime state$.state.ticketTitleSet with $state, read anywhere in the form
Registry variables$.variable.keyNameData variables from the registry, overridable per theme
Image variables$.image.keyNameImage assets from the registry, overridable per theme (light/dark)
Script functions$.fn.keyName()Callable registry functions with read-only runtime context

Direct paths vs. expressions

A direct path like $.self.name resolves in text, scripts, defaults, and labels. To call a helper or compute a value inside Text Display, wrap it in {{ }} โ€” for example {{ $sum('line_total') }}. See Variable Reference โ€บ Runtime caveats.


See also: Scripts overview ยท Code Helpers ยท Variable Reference