Variable Reference โ
How the variable namespaces fit together โ from registry defaults, through theme overrides, to the values a form renders at runtime. For the values themselves see Runtime Variables; for the helper functions see Code Helpers.
Namespaces โ
| Namespace | Source | Writable | Persistence |
|---|---|---|---|
$.self.* | Auth session (user profile) | No | Backend-managed |
$.form.* | Current form metadata | No | Loaded form record |
$.state.* | $state() in scripts | Yes โ scripts only | In-memory only (cleared on refresh) |
$.variable.* | Registry + active theme override | No | Backend (registry + theme.custom/custom_dark) |
$.image.* | Image-type registry variables | No | Backend (registry + theme.images/images_dark) |
$.fn.*() | Script-type registry variables | Callable | Backend registry only |
Compatibility matrix โ
Which namespaces resolve in which context. $.fn() entries marked โ are allowed but read-only โ the function returns a value and the caller decides whether to $set or $state it.
| Context | $.self | $.form | $.state | $.variable | $.image | {{ expr }} | $.fn() |
|---|---|---|---|---|---|---|---|
| Field default values | โ | โ | โ | โ | โ | โ | โ |
| Field labels / placeholders | โ | โ | โ | โ | โ | โ | โ |
| Option labels | โ | โ | โ | โ | โ | โ | โ |
| Text Display header / body | โ | โ | โ | โ | โ | โ | โ |
| On Load / onChange scripts | โ | โ | โ | โ | โ | โ | โ |
| Button action scripts | โ | โ | โ | โ | โ | โ | โ |
| Visibility scripts | โ | โ | โ | โ | โ | โ | โ |
| Visual visibility rules (compare) | โ | โ | โ | โ | โ | โ | โ |
| Visual validation rules (compare) | โ | โ | โ | โ | โ | โ | โ |
Runtime caveats โ
$.pathis for direct value lookup.{{ }}is required for helper calls or computation. Do not use a bare$get()in text.- Inside
{{ }}:$.self,$.form,$.state,$.variable,$.image,$.fn,$get,$sum,$option,Math, etc. are available.{{ }}expressions are read-only. {{ }}expressions are read-only โ no$set,$statewrites, or$grid. Use On Load scripts for write operations.{{ }}expressions only work in Text Display header and body โ not in field labels, defaults, or option labels.$.formis form metadata.$.stateis in-memory only and cleared on page refresh. Use$.variablefor persistent values.$.fnregistry functions are read-only in every caller context. Return a value and let the caller decide whether to$setor$stateit.$.fnfunctions with no return are treated as void. Use the usage hintsfn:returnableorfn:voidto make intent visible in the registry UI.- Text-type variables only resolve
$.variable.*tokens at registry level.$.self,$.form, and$.stateresolve later, at form render time. - Theme runtime can resolve
custom/custom_darkfor data variables. The Data Variables override tab manages the default/light bucket; dark-specific values still resolve when present on the active theme. $.imagevariables support light/dark overrides viatheme.imagesandtheme.images_dark. Registry defaults apply when no theme override exists.
Data-variable types โ
Registry data variables are typed. The type controls how the stored value is parsed and which namespace exposes it.
| Type | Namespace | Parsed to | Use case |
|---|---|---|---|
string | $.variable | string | Config values, display text |
number | $.variable | number (if finite) | Thresholds, counts, rates |
boolean | $.variable | true / false | Feature flags |
date | $.variable | ISO string | Reference dates |
json | $.variable | object / array | Structured config |
list | $.variable | string[] | Dropdown options, lookups |
text | $.variable | resolved string | Composable text with $.variable.* tokens |
script | $.fn | callable function | Registry-owned reusable logic |
image | $.image | string (URL) | Theme-overridable image assets |
See also: Scripts overview ยท Runtime Variables ยท Examples
