Skip to main content

Set Variable

Set Variable

The Set Variable flow element creates or updates a variable that can be referenced later in the flow.

This is useful for storing values like flags, counters, or dynamically generated text for use in conditional logic or file paths.


Variable

The name of the variable to set.

  • Supports variable substitution using {VariableName} syntax
  • The resolved name must:
    • Start with a letter (a-z, A-Z) or underscore (_)
    • Contain only letters, numbers, underscores (_), and dots (.)
    • Not start with a digit or a dot
    • Not contain spaces or special characters

✅ Examples of valid names:

  • flag
  • count.total
  • result_{StepNumber} → becomes result_2 if StepNumber=2

❌ Examples of invalid resolved names:

  • 1start
  • .hidden
  • invalid name
danger

After substitution, the final name must match the pattern:
^[a-zA-Z_][a-zA-Z0-9_\.]*$


Value

The value to assign to the variable.

  • Also supports variable substitution using {VariableName}
  • The final value is automatically cast to the appropriate type:
Input ValueStored As
true / falseBoolean
123Integer
12.34Float
Anything elseString

🔁 Example:

If Username = bob, and you set:

  • Variable: user.{Username}
  • Value: active_{Username}

Then this will store a variable named user.bob with the value "active_bob" (string).