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
| Type | Description | Example default value |
|---|---|---|
String | Text | "Hello" |
Int32 | 32-bit integer | 0 |
Int64 | 64-bit integer (large numbers) | 0 |
Double | Floating-point decimal | 0.0 |
Boolean | True or false | false |
DateTime | Date and time value | DateTime.Now |
DataTable | Tabular data (rows + columns) | empty table |
DataRow | A single row from a DataTable | — |
StringArray | Array of strings | empty |
Int32Array | Array of integers | empty |
List | Generic list of objects | empty |
Object | Any value (avoid when possible) | — |
Declaring Variables
- Open the Variables Panel at the bottom of the designer
- Click + Add Variable (or press
Alt+N) - Set Name (camelCase recommended — e.g.,
invoiceTotal), Type, and optional Default Value - Scope is
Workflowby default (available everywhere); set toLocalfor 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:
| Direction | Meaning |
|---|---|
| In | Caller supplies a value; sub-workflow reads it |
| Out | Sub-workflow writes a value; caller captures it |
| In/Out | Both — 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.| Type | Correct format | Example |
|---|---|---|
| String literal | "double quoted" | "Processing complete" |
| Empty string | "" | "" |
| Integer | bare number | 42 |
| Decimal | bare number | 3.14 |
| Boolean | true or false | true |
| 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).