~4 min6 / 16

Variables & Expressions

Variables store data that flows between activities. Expressions let you compute values, build strings, and make comparisons. Getting the format right is the most common source of beginner errors — this page covers all rules precisely.

Variable Types

TypeDescriptionExample default value
StringText"Hello"
Int3232-bit integer0
Int6464-bit integer (large numbers)0
DoubleFloating-point decimal0.0
BooleanTrue or falsefalse
DateTimeDate and time valueDateTime.Now
DataTableTabular data (rows + columns)empty table
DataRowA single row from a DataTable
StringArrayArray of stringsempty
Int32ArrayArray of integersempty
ListGeneric list of objectsempty
ObjectAny value (avoid when possible)

Declaring Variables

  1. Open the Variables Panel at the bottom of the designer
  2. Click + Add Variable (or press Alt+N)
  3. Set Name (camelCase recommended — e.g., invoiceTotal), Type, and optional Default Value
  4. Scope is Workflow by default (available everywhere); set to Local for loop-scoped variables

Arguments (for Invoke Workflow)

Use the Arguments tab in the Variables Panel to define parameters that callers pass in. Arguments have a direction:

DirectionMeaning
InCaller supplies a value; sub-workflow reads it
OutSub-workflow writes a value; caller captures it
In/OutBoth — caller provides an initial value and gets the modified value back

Value Format Rules

String literals must be quotedIn the Value field of Assign, always wrap text in double quotes: "Hello World". Bare text like Hello World (without quotes) is treated as a variable name and will cause an "Unknown variable" error at runtime.
TypeCorrect formatExample
String literal"double quoted""Processing complete"
Empty string""""
Integerbare number42
Decimalbare number3.14
Booleantrue or falsetrue
Variable reference${name}${invoiceTotal}
Template string"text ${var}""Hi ${customerName}"
Arithmetic${a} + ${b}${subtotal} * 1.18

Expressions in Conditions (If / While)

workflow
1${score} >= 90
2${count} == 0
3${status} == "Active"
4${age} >= 18 && ${age} <= 65
5${a} == "X" || ${a} == "Y"
6!${isLoggedIn}

Variable Picker

Press Ctrl+Space in any property field to open the variable picker. It lists all in-scope variables with their types, letting you insert references without typing.

Type ConversionWhen you call Assign with a value that doesn't match the declared type, Studio automatically converts it (e.g., assigning 42 to a String variable produces "42"). The Variables Panel shows a yellow warning when a type conversion is lossy (e.g., Double → Int32).
Was this helpful?