Skip to main content

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

InputTypeDescriptionDefault
NameTextThe name or path of the form variable to retrieve. Supports Handlebars templating (e.g., {{prefix}}_counter).-

Outputs

OutputTypeDescription
ValueDataContains 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 name input 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 (formVariables path), 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 undefined rather than throwing an error.

Example Usage

Basic Variable Retrieval

Connect a UI Variable node to read a simple form variable named userEmail:

  1. Set the Name input to: userEmail
  2. 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:

  1. Set the Name input to: counter_{{userId}}
  2. Connect a data source to the dynamically created userId input
  3. 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:

  1. Set the Name input to: userProfile.settings.theme
  2. The node retrieves the theme property from the userProfile variable's settings object.
Related Nodes