You are here:
Flow Operators in Assignment Elements
Use Assignment element operators to change the value of a selected resource.
Required Editions
| View supported editions. |
Use this reference to understand the supported operators. The reference organizes operators by the data type you select for Resource.
Apex-Defined
Match the @AuraEnabled attribute’s Apex data type with a flow data type in this reference to find which operators the flow supports.
| Apex Data Type | Flow Data Type |
|---|---|
| Boolean | Boolean |
| Date | Date |
| DateTime | Date/Time |
| Decimal | Number |
| Double | Number |
| Integer | Number |
| List | Collection |
| Long | Number |
| String | Text |
| Time | Time |
Boolean
Replace a Boolean resource with a new value.
| Operator | Description | Supported Data Types | Example |
|---|---|---|---|
| Equals | What you enter or select for Value replaces the value of Variable. | Boolean | Before Assignment: Assignment: After Assignment:
|
Collection
Update or replace the value of a collection variable or record collection variable.
| Operator | Description | Supported Data Types | Example |
|---|---|---|---|
| Equals | Value replaces the value of Variable. | Collection of the same data type or object type Text, Picklist, and Multi-Select Picklist data types are compatible with each other. |
Before the Assignment:
Assignment: After the Assignment:
|
| Add | Appends Value as a new item to the end of the collection in Variable. | Variable of the same data type or record variable of the same object type Text, Picklist, and Multi-Select Picklist data types are compatible with each other. You can also add stages (including $Flow.CurrentStage) to text collections. |
Before the Assignment:
Assignment: After the Assignment:
|
| Remove After First | Finds the first instance of Value in the collection in Variable and removes all items after it. | Variable of the same data type or record variable of the same object type For text collections only:
|
Before the Assignment:
Assignment: After the Assignment:
|
| Add At Start | Appends Value as a new item to the beginning of the collection in Variable. | Collection of the same data type or object type Variable of the same data type or record variable of the same object type For text collections only:
|
Before the Assignment:
Assignment: After the Assignment:
|
| Remove All | Removes all instances of Value from the collection in Variable. | Collection of the same data type or object type Variable of the same data type or record variable of the same object type For text collections only:
|
Before the Assignment:
Assignment: After the Assignment:
|
| Remove First | Removes the first instance of Value from the collection in Variable. | Collection of the same data type or object type For text collections only:
|
Before the Assignment:
Assignment: After the Assignment:
|
| Remove Before First | Finds the first instance of Value in the collection in Variable and removes all items before it. | Variable of the same data type or record variable of the same object type For text collections only:
|
Before the Assignment:
Assignment: After the Assignment:
|
| Remove Position | Removes the item at the position that you enter for Value from the collection in Variable. Make sure that Value at run time is a positive integer that's within the range of the number of items in the collection in Variable. |
Number | Before the Assignment:
Assignment: After the Assignment:
|
| Remove Uncommon | Keeps only the items in Variable that match items in Value and removes all others. | Collection of the same data type or object type | Before the Assignment:
Assignment: After the Assignment:
|
| Equals Count | The number of stages or collection items in what you enter for Value replaces the value of Variable. Record choice sets aren't supported as a value. |
|
Before the Assignment:
Assignment: After the Assignment:
|
Currency and Number
Replace (Equals), add to (Add), or subtract from (Subtract) the value of a currency or number resource. Count (Equals Count) the number of active stages or the number of items in a collection.
| Operator | Description | Supported Data Types | Example |
|---|---|---|---|
| Equals | The number that you enter or select for Value replaces the value of Variable. |
|
Before the Assignment: Assignment: After the Assignment: |
| Add | Adds the number that you enter or select for Value to the value of Variable. |
|
Before the Assignment: Assignment: After the Assignment: |
| Subtract | Subtracts the number that you enter or select for Value from the value of Variable. |
|
Before the Assignment: Assignment: After the Assignment: |
Date
Replace (Equals), add to (Add), or subtract from (Subtract) the value of a date/time resource.
{!$Flow.CurrentDate} and use the Add or Subtract operator. For example,
to calculate a date 7 days from today, assign {!$Flow.CurrentDate}
Add
7 to your date variable.| Operator | Description | Supported Data Types | Example |
|---|---|---|---|
| Equals | The date that you enter or select for Value replaces the value of Variable. |
|
Example 1: Set to a specific date: Before the assignment:
Assignment:
After the assignment: Example 2: Set to today’s date: Before
the assignment: Assignment: After the assignment:
|
| Add | Adds Value in days to Variable’s value. |
|
Example 1: Add days to a specific date: Before the assignment:
Assignment:
After the assignment: Example 2: Add days to today’s date: Before the assignment: Assignment: After the assignment: |
| Subtract | Subtracts Value in days from Variable’s value. |
|
Example 1: Subtract days from a specific date: Before the assignment:
Assignment: After the assignment: Example 2: Subtract days from today’s date: Before the assignment: Assignment: After the assignment: |
Date/Time
Replace a date/time resource with a new value (Equals).
| Operator | Description | Supported Data Types | Example |
|---|---|---|---|
| Equals | The date that you enter or select for Value replaces the value of Variable. |
|
Before the Assignment: Assignment: After the Assignment:
|
Picklist
Replace a picklist resource with a new value (Equals) or concatenate a value onto the original value (Add).
| Operator | Description | Supported Data Types | Example |
|---|---|---|---|
| Equals | What you enter or select for Value replaces the value of the selected picklist. |
|
Before the Assignment: Assignment: After the Assignment:
|
| Add | Appends what you enter or select for Value to the end of the selected picklist. |
|
Before the Assignment: Assignment: After the Assignment:
|
Multi-Select Picklist
Replace a multi-select picklist resource with a new value (Equals), concatenate a value onto the original value (Add), or add a selection to the resource (Add Item).
| Operator | Description | Supported Data Types | Example |
|---|---|---|---|
| Equals | What you enter or select for Value replaces the value of the selected multi-select picklist. |
|
Before the Assignment: Assignment: After the Assignment: |
| Add | Appends what you enter or select for Value to the last selected item in the multi-select picklist. The Add operator doesn’t create a selection. To add items as new selections, use the Add Item operator. To add
semi-colon-delimited items to a multi-select picklist variable with the Add
operator, always add a single space after the semi-colon and don’t include a space
before the semi-colon. This way, the variable’s values match the values of
multi-select picklist fields in Salesforce. For example:
|
|
Before the Assignment: Assignment:
After the Assignment: |
| Add Item | Adds what you enter or select for Value as a new selection to the end of the multi-select picklist. The Assignment automatically adds “;” before the new item. That way, Salesforce treats it as a separate selection. |
|
Before the Assignment: Assignment: After the Assignment:
|
Record
Replace a record variable with a new value (Equals).
| Operator | Description | Supported Data Types | Example |
|---|---|---|---|
| Equals | The record variable that you select for Value replaces the value of Variable. | Record – with the same object type | Before the Assignment:
Assignment: After the Assignment: both
|
Stage
You can’t update the value of a stage, but you can update the values of the stage global
variables: $Flow.CurrentStage and $Flow.ActiveStages.
$Flow.CurrentStage
Replace the stage selected in $Flow.CurrentStage.
| Operator | Description | Supported Data Types | Example |
|---|---|---|---|
| Equals | Value replaces the value of $Flow.CurrentStage. |
|
Before the Assignment: Assignment: After the Assignment:
|
$Flow.ActiveStages
Add or remove active stages in the $Flow.ActiveStages global variable.
| Operator | Description | Supported Data Types | Example |
|---|---|---|---|
| Add | Appends Value to the end of $Flow.ActiveStages. |
|
Before the Assignment: Assignment: After the Assignment:
|
| Remove After First | Finds the first instance of the stage in Value within
$Flow.ActiveStages and removes all stages after it. |
|
Before the Assignment: Assignment:
After the Assignment:
|
| Add At Start | Adds Value to the beginning of $Flow.ActiveStages. |
|
Before the Assignment: Assignment: After the Assignment:
|
| Remove All | Removes all instances of Value from
$Flow.ActiveStages. |
|
Before the Assignment: Assignment: After the Assignment:
|
| Remove First | Removes the first instance of the stage in Value from
$Flow.ActiveStages. |
|
Before the Assignment: Assignment:
After the Assignment:
|
| Remove Before First | Finds the first instance of the stage in Value within
$Flow.ActiveStages and removes all stages before it. |
|
Before the Assignment: Assignment:
After the Assignment:
|
| Remove Position | Removes the stage at the position that you enter for Value from
Make sure that Value at run time is a
positive integer that is within the range of the number of stages in
|
Number | Before the Assignment:
Assignment: After the Assignment:
|
| Equals Count | The number of stages or collection items in what you enter for Value replaces the value of Variable. Record choice sets aren't supported as a value. |
|
Before the Assignment:
Assignment: After the Assignment:
|
Text
Replace a text resource with a new value (Equals) or concatenate a value onto the end of the original value (Add).
| Operator | Description | Supported Data Types | Example |
|---|---|---|---|
| Equals | The text that you enter or select for Value replaces the value of Variable. |
|
Before the Assignment: Assignment: After the Assignment: |
| Add | Appends the text that you enter or select for Value to the end of Variable. |
|
Before the Assignment: Assignment: After the Assignment: |
Time
Replace a time resource with a new value (Equals).
| Operator | Description | Supported Data Types | Example |
|---|---|---|---|
| Equals | The time that you enter or select for Value replaces the value of Variable. | Time | Before the Assignment:
Assignment: {!varTime} Equals 09:00 AM After the Assignment:
|
