UI Variable
Uncontrolled node
Overview
The UI Variable node retrieves values from the form's variable store, allowing workflows to access UI state and data that has been set by user interactions or other workflow logic. Unlike the standard Variable node which accesses workflow-scoped variables, this node specifically reads from the form's runtime variable storage.
Form variables are typically set using the Set UI Variable node or through direct user interactions with form elements. This node enables dynamic retrieval of those values using template expressions, supporting Handlebars syntax ({{variableName}}) to construct variable names from other data inputs.
Dynamic Inputs
When you enter a Handlebars template in the Name field (e.g., user_{{userId}}_preference), the node automatically creates additional input sockets for each referenced variable (userId in this example). These dynamic inputs allow you to build variable names programmatically based on runtime data.
Inputs
| Input | Type | Description | Default |
|---|---|---|---|
| Name | Text | The name or path of the form variable to retrieve. Supports Handlebars templating (e.g., {{prefix}}_counter). | - |
Outputs
| Output | Type | Description |
|---|---|---|
| Value | Data | Contains the value of the specified form variable. Returns undefined if the variable does not exist. |
Runtime Behavior and Defaults
- Uncontrolled Execution: This node runs automatically whenever its inputs change, without requiring an event trigger. It outputs the current value of the specified form variable immediately.
- Handlebars Resolution: The
nameinput is processed as a Handlebars template, allowing dynamic variable name construction using other input values. - Storage Location: Reads from the form's runtime variable storage (
formVariablespath), which is separate from workflow variables. - Path Normalization: Variable names are trimmed and normalized before lookup. Dots in the name are converted to path separators for nested variable access.
- No Error on Missing: If the specified variable does not exist, the node outputs
undefinedrather than throwing an error.
Example Usage
Basic Variable Retrieval
Connect a UI Variable node to read a simple form variable named userEmail:
- Set the Name input to:
userEmail - The node outputs the value that was previously set via Set UI Variable or UI interaction.
Dynamic Variable Names
Retrieve a variable whose name depends on another input:
- Set the Name input to:
counter_{{userId}} - Connect a data source to the dynamically created
userIdinput - The node resolves the template (e.g.,
counter_123) and retrieves the corresponding form variable value.
Accessing Nested Data
Form variables can store complex objects. Use dot notation in the name to access nested properties:
- Set the Name input to:
userProfile.settings.theme - The node retrieves the
themeproperty from theuserProfilevariable'ssettingsobject.
- Use Set UI Variable to write values to form variables
- Use UI Element Data to read directly from specific UI elements
- Use Variable for workflow-scoped variables (not form-scoped)