Logic Composer
Variables steps
Reference for New Variable, Update Variable and Set Output, the steps that keep values, change them and return them.
These three steps hold the flow’s state: declare a value, change it, and hand results back to whoever started the flow. For the bigger picture, including the variables other steps publish and how scope works, see Variables.
New Variable
Section titled “New Variable”Declares a variable that later steps can use. The variable’s name is the step name.
| Setting | What it does | Required |
|---|---|---|
| Type | Yes/No, Date and Time (with a behavior: Date Only, Time Zone Independent or User Local), Decimal Number, Floating Point Number, Currency, Whole Number, Text, Row (choose the table), Lookup (choose the table), Choice (choose the choice), Template Definition (a template from the Templates tab), or Object (only when objects are defined). | Yes |
| One value or List of values | Whether the variable holds one value or a list, for example “Holds a list of rows”. | Yes |
Outputs: <Step>, the variable itself.
Behavior: there is no initial value field. The variable starts empty; a Row variable starts as a new, unsaved row of its table. Set its value with Update Variable.
Dynamics 365 CE on-premisesType labelsApplies to the other edition
On-premises shows Two Options, Entity and Option Set instead of Yes/No, Row and Choice.
Example: New Variable Invoice of type Row (Invoice), then Update Variable to set its fields, then Save Entity to create it.
Update Variable
Section titled “Update Variable”Changes a variable, or fields of a row or object variable.
| Setting | What it does | Required |
|---|---|---|
| Variable | The variable to change. Fixed once the step is saved. | Yes |
| Fields (Row or Object variables) | One line per field, each with an operator and a value. | Yes |
| Value (other variables) | An operator and an expression. | Yes |
Operators:
| Operator | What it does |
|---|---|
| Set | Replaces the value with the expression’s result. |
| Set to Nothing | Clears the value. |
| Add Item To Collection | Adds the expression’s result to a list variable. |
| Remove Item From Collection | Removes the expression’s result from a list variable. |
Outputs: none. The variable itself changes.
Behavior: you can update a variable declared outside the current branch, loop or Try, for example a running total declared before an Iterator and updated inside it.
Example: inside an Iterator EachLine, Update Variable Total → Set Total + EachLine.Item.extendedamount. Or add the current contact to a list variable Recipients with Add Item To Collection EachContact.Item.
Set Output
Section titled “Set Output”Gives values to the flow’s outputs, which you define on the Output tab.
| Setting | What it does | Required |
|---|---|---|
| One value per output | An expression for each output you want to set. | At least one (“At least one output argument must be set”) |
Outputs: none. The values are returned when the flow ends.
Behavior:
- A flow can have several Set Output steps, for example one in each branch. The last value set for each output is the one returned.
- Outputs set before a Halt are returned.
Example: at the end of an approval flow, set IsApproved = Yes and ApprovedAmount = GetQuote.totalamount.