Skip to content
v2.6

Using Global Variables ​

Introduction ​

Global variables are form-level constants that are injected into the form model when the form loads. They let you define fixed values once and reference them anywhere in the form — in property bindings, conditional visibility, and default values — without hardcoding the same value in multiple places.

Where to define them ​

  1. Open your form in the editor
  2. Go to the Global variables tab
  3. Click + Add variable
  4. Fill in:
    • Name — the identifier you will use in bindings (e.g. maxScore)
    • Type — one of: String, Number, Boolean, JSON
    • Value — the value, coerced to the selected type
    • Visible in form model — whether the variable appears as a readable field in the form model

Supported value types ​

TypeExample value
String"Hello world"
Number100
Booleantrue
JSON{ "threshold": 80, "label": "Pass" }

JavaScript literal objects are also accepted as values.

Using a global variable in a binding ​

Global variables are available as paths in all property bindings — the same way ruleset fields are. For example:

  • An Output element's Path can be set to maxScore to display the variable's value
  • A conditional visibility rule can compare a field against maxScore
  • A Hidden input's default value can reference maxScore

Example — configuring a pass/fail threshold ​

You want a form to highlight a score as passing when it exceeds a threshold, but you want the threshold to be easy to change without editing every element.

  1. Create a new Ruleset
  2. Create an input named score of type number
  3. Create a new Form
  4. Go to the Global variables tab
  5. Add a global variable: Name passThreshold, Type Number, Value 60
  6. Go to the Definition tab
  7. Add an Input element with : Label Score,Type Number
  8. Add an Alert element with Label Score is passing and with Visibility conditional visibility:
    • Condition: score >= passThreshold
  9. Save the Ruleset

Previewing the Form ​

  1. Click the Preview button in the top right corner

To change the threshold later, update the global variable — no other changes needed

Tips ​

  • Global variables are read-only at runtime — they cannot be changed by actions or rulesets during form execution
  • If you need a value that changes at runtime, use a Hidden input with a default value instead
  • JSON-type variables are useful for passing structured configuration (e.g. a list of allowed values or a settings object) into the form model
  • Variables set to not visible in the form model are still usable in bindings, but will not appear in debugging/inspection tools