Variables, arguments and expressions in Studio

Declare variables and arguments in the Data panel, choose types and defaults, write expressions with IntelliSense, and use the Properties panel.

Data moves through a workflow in variables, and in and out of it through arguments. Every property, condition and assignment takes an expression in the project's expression language, C# or Visual Basic, chosen when the project was created. Add a variable# A variable holds a value while the workflow runs. It is visible in the container that declares it (its scope) and everything nested in it. On the canvas, select the container the variable belongs to, for example a Sequence. Open the Data panel (bottom) and select Variables. Select Add variable (or press Insert). The scope it will get is shown next to the button. Name the variable. New variables are String; pick another Type if you need one. Optionally enter a Default value as an expression, for example 0 or new List<string>(). To change a variable's scope later, pick another one in the Scope column. Only the selected scope limits the list to the selected container. The Uses column counts where the variable is used. Create a variable from an expressionType a name that does not exist yet in an expression field, then press Ctrl + K (Create variable) or Ctrl + M (Create argument). Studio asks for the name, type and scope. Add an argument# Arguments are a workflow's contract with its callers. An entry point's arguments become the job's inputs and outputs, and Invoke Workflow binds to them. Direction Use In A value passed into the workflow Out A value the workflow returns In/Out A value passed in and returned, possibly changed In the Data panel, select Arguments. Select Add argument (or press Insert). New arguments are In and String. Set the Name, Direction, Type, an optional Default, and Required if callers must pass a value. Use Move up and Move down to set the order callers see. Argument names reach the Orchestrator's start form exactly as you type them. Choose a type# The Type column offers common types as you type. For anything else, select Browse for types… at the end of the list, search, and select Select. Manage imports# The Imports tab lists the namespaces expressions can use without a full name. Type a namespace, such as System.Text.Json, and select Add import. Select Remove to drop one. Remove what nothing uses# On the Design ribbon tab, Remove unused has Remove unused variables, Remove unused arguments and Remove unused imports. Studio checks the whole project, lists what it will delete and asks you to confirm. Undo brings the items back. Arguments of entry points, and arguments an Invoke Workflow binds, are kept. Write expressions# Expression fields are marked fx. IntelliSense suggests variables, arguments, members and types: Action Keys Show completions Ctrl + Space (or start typing, or type .) Show parameter help Ctrl + Shift + Space, or type ( or , Show quick info Ctrl + K, Ctrl + I Fix an unknown name Ctrl + . C# examplesC#Copy"Invoice " + InvoiceNumber // string concatenation Total > 1000m && Currency == "EUR" // Boolean condition DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd") Rows.Count == 0 ? "empty" : $"{Rows.Count} rows" String literals need quotes. In C#, escape backslashes in Windows paths ("C:\\Temp\\out.txt") or use a verbatim string (@"C:\Temp\out.txt"). Expressions are checked as you type. An error shows a glyph in the field, the activity shows an error, and the Error List lists it. Use the Expression editor# For longer expressions, open the Expression editor: select Open expression editor in the field, or press Ctrl + Shift + E while the field has focus. Write the expression. Insert variable (Ctrl + Shift + V) lists what is in scope, and Format (Ctrl + K, Ctrl + D) tidies it. The status bar shows a check mark, or the first error. Select the light bulb (Show fixes) to create a missing variable or argument. Select Apply (Ctrl + Enter), or Cancel (Esc). Use the Properties panel# Properties (F4) shows the selected activity's properties, grouped (Common, Input, Output, Options and so on), with Advanced collapsed. Use Search at the top to find a property. A red * marks a required property. Out and In/Out properties show their direction. Right-click a row to Use a value or Use an expression (for Boolean properties, switch between a check box and an expression), Open in expression editor, Clear value or Revert unapplied change (Esc). Select the pin on a row (Show on card) to show its value on the activity's card. Project-wide values# Values every workflow needs, such as a base URL, can be declared once in Project settings > Globals and constants. For values that differ between environments or are secret, use Orchestrator assets and credentials instead; see Credentials and assets. Next steps# Check values while the workflow runs: Run and debug workflows.

Add a variable

Add an argument

Choose a type

Manage imports

Remove what nothing uses

Write expressions

Use the Expression editor

Use the Properties panel

Project-wide values

Next steps