Loading
Salesforce now sends email only from verified domains. Read More
Automate Your Business Processes
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Flow Operators in Assignment Elements

          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 list is organized according to the data type that you select for Resource.

          Note
          Note Looking for the sObject data type from Cloud Flow Designer? In Flow Builder, we replaced sObject with the Record data type. So your sObject collection variables are now record collection variables.

          Apex-Defined

          Match the @AuraEnabled attribute’s Apex data type with a flow data type in this reference to determine which operators are supported.

          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: {!varBoolean} is false

          Assignment: {!varBoolean} Equals {!$GlobalConstant.True}

          After Assignment: {!varBoolean} is true

          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:

          • {!collText} is Yellow, Green, Blue
          • {!collPicklist} is Blue, Red, Orange

          Assignment: {!collText} Equals {!collPicklist}

          After the Assignment: {!collText} is Blue, Red, Orange

          Add Value is added as a new item at 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.

          Stages (including $Flow.CurrentStage) can be added to text collections.

          Before the Assignment:

          • {!collText} is Yellow, Green, Blue
          • {!varPicklist} is Red

          Assignment: {!collText} Add {!varPicklist}

          After the Assignment: {!collText} is Yellow, Green, Blue, Red

          Remove After First The first instance of Value is found within the collection in Variable. All items after the first instance are removed from the collection in Variable.

          Variable of the same data type or record variable of the same object type

          For text collections only:

          • Multi-Select Picklist
          • Picklist
          • $Flow.CurrentRecord

          Before the Assignment:

          • {!collText} is Red, Orange, Yellow, Green, Blue
          • {!varText} is Yellow

          Assignment: {!collText} Remove After First {!varText}

          After the Assignment: {!collText} is Red, Orange, Yellow

          Add At Start Value is added as a new item at 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:

          • Multi-Select Picklist
          • Picklist
          • $Flow.CurrentRecord

          Before the Assignment:

          • {!collText} is Yellow, Green, Blue
          • {!varPicklist} is Red

          Assignment: {!collText} Add At Start {!varPicklist}

          After the Assignment: {!collText} is Red, Yellow, Green, Blue

          Remove All All instances of Value are removed 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:

          • Multi-Select Picklist
          • Picklist
          • $Flow.CurrentRecord

          Before the Assignment:

          • {!collText} is Red, Orange, Red, Yellow
          • {!varText} is Red

          Assignment: {!collText} Remove All {!varText}

          After the Assignment: {!collText} is Orange, Yellow

          Remove First The first instance of Value is removed from the collection in Variable.

          Collection of the same data type or object type

          For text collections only:

          • Multi-Select Picklist
          • Picklist
          • $Flow.CurrentRecord

          Before the Assignment:

          • {!collText} is Red, Orange, Red, Yellow
          • {!varText} is Red

          Assignment: {!collText} Remove First {!varText}

          After the Assignment: {!collText} is Orange, Red, Yellow

          Remove Before First The first instance of Value is found within the collection in Variable. All items before the first instance are removed from the collection in Variable.

          Variable of the same data type or record variable of the same object type

          For text collections only:

          • Multi-Select Picklist
          • Picklist
          • $Flow.CurrentRecord

          Before the Assignment:

          • {!collText} is Red, Orange, Yellow, Green, Blue
          • {!varText} is Yellow

          Assignment: {!collText} Remove Before First {!varText}

          After the Assignment: {!collText} is Yellow, Green, Blue

          Remove Position

          Value specifies a position in the collection. The item at the position is removed from the collection in Variable.

          Make sure that Value at run time is a positive integer that is within the range of the number of items in the collection in Variable.

          Number

          Before the Assignment:

          • {!collText} is Red, Orange, Yellow
          • {!varNum} is 2

          Assignment: {!collText} Remove Position {!varNum}

          After the Assignment: {!collText} is Red, Yellow

          Remove Uncommon The items in the Value collection are found within the Variable collection. The found items are kept, and all other items are removed from the collection in Variable. Collection of the same data type or object type

          Before the Assignment:

          • {!collText1} is Red, Orange, Yellow, Green
          • {!collText2} is Orange, Green, Blue

          Assignment: {!collText1} Remove Uncommon {!collText2}

          After the Assignment: {!collText1} is Orange, Green

          Equals Count The number of stages or collection items in what you enter for Value replaces the value of Variable.
          • Collection
          • $Flow.ActiveStages

          Before the Assignment:

          • {!varNumber} is 0
          • {!collText} is Yellow, Green, Blue

          Assignment: {!varNumber} Equals Count {!collText}

          After the Assignment: {!varNumber} is 3

          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.
          • Currency
          • Number

          Before the Assignment: {!varCurrency} is 10

          Assignment: {!varCurrency} Equals 7

          After the Assignment: {!varCurrency} is 7

          Add The number that you enter or select for Value is added to the value of Variable.
          • Currency
          • Number

          Before the Assignment: {!varCurrency} is 10

          Assignment: {!varCurrency} Add 7

          After the Assignment: {!varCurrency} is 17

          Subtract The number that you enter or select for Value is subtracted from the value of Variable.
          • Currency
          • Number

          Before the Assignment: {!varCurrency} is 10

          Assignment: {!varCurrency} Subtract 7

          After the Assignment: {!varCurrency} is 3

          Date

          Replace (Equals), add to (Add), or subtract from (Subtract) the value of a date/time resource.

          Operator Description Supported Data Types Example
          Equals The date that you enter or select for Value replaces the value of Variable.
          • Date
          • Date/Time

          Before the Assignment: {!varDate} is 1/16/2016

          Assignment: {!varDate} Equals 1/15/2016

          After the Assignment: {!varDate} is 1/15/2016

          Add Value is added, in days, to the selected Variable’s value.
          • Currency
          • Number

          Before the Assignment: {!varDate} is 1/16/2016

          Assignment: {!varDate} Add 7

          After the Assignment: {!varDate} is 1/23/2016

          Subtract Value is subtracted, in days, from the selected Variable’s value.
          • Currency
          • Number

          Before the Assignment: {!varDate} is 1/16/2016

          Assignment: {!varDate} Subtract 7

          After the Assignment: {!varDate} is 1/9/2016

          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.
          • Date
          • Date/Time

          Before the Assignment: {!varDateTime} is 1/16/2016 01:00

          Assignment: {!varDateTime} Equals 1/16/2016 08:00

          After the Assignment: {!varDateTime} is 1/16/2016 08:00

          Picklist

          Replace a picklist resource with a new value (Equals) or concatenate a value onto the original value (Add).

          Note
          Note Before values are assigned or added to a picklist resource, they’re converted into string values.
          Operator Description Supported Data Types Example
          Equals What you enter or select for Value replaces the value of the selected picklist.
          • Boolean
          • Currency
          • Date
          • Date/Time
          • Multi-Select Picklist
          • Number
          • Picklist
          • Text
          • Stage
          • Time

          Before the Assignment: {!varPicklist} is Blue

          Assignment: {!varPicklist} Equals Yellow

          After the Assignment: {!varPicklist} is Yellow

          Add What you enter or select for Value is added to the end of the selected picklist.
          • Boolean
          • Currency
          • Date
          • Date/Time
          • Multi-Select Picklist
          • Number
          • Picklist
          • Text
          • Stage
          • Time

          Before the Assignment: {!varPicklist} is Blue

          Assignment: {!varPicklist} Add -green

          After the Assignment: {!varPicklist} is Blue-green

          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).

          Note
          Note Before values are assigned or added to a multi-select picklist resource, they’re converted into string values.
          Operator Description Supported Data Types Example
          Equals What you enter or select for Value replaces the value of the selected multi-select picklist.
          • Boolean
          • Collection
          • Currency
          • Date
          • Date/Time
          • Multi-Select Picklist
          • Number
          • Picklist
          • Text
          • Stage
          • Time

          Before the Assignment: {!varMSP} is Blue

          Assignment: {!varMSP} Equals Yellow

          After the Assignment: {!varMSP} is Yellow

          Add

          What you enter or select for Value is added to the last item selected in the multi-select picklist. It doesn’t create a selection.

          Easily add items to a multi-select picklist resource by using 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, you can compare the variable’s values to the values of a multi-select picklist field from the Salesforce database. For example: ; Yellow

          • Boolean
          • Currency
          • Date
          • Date/Time
          • Multi-Select Picklist
          • Number
          • Picklist
          • Text
          • Stage
          • Time

          Before the Assignment: {!varMSP} is Blue; Green. This value includes two separate selections

          Assignment: {!varMSP} Add Yellow

          After the Assignment: {!varMSP} is Blue; GreenYellow. This value includes two separate selections

          Add Item What you enter or select for Value is added as a new selection to the end of the multi-select picklist. The Assignment automatically adds “;” before the new item. That way, Salesforce reads it as a separate item selected by the multi-select picklist.
          • Boolean
          • Currency
          • Date
          • Date/Time
          • Multi-Select Picklist
          • Number
          • Picklist
          • Text
          • Time

          Before the Assignment: {!varMSP} is Blue; Green

          Assignment: {!varMSP} Add item Yellow

          After the Assignment: {!varMSP} is Blue; Green; Yellow. This value includes three separate selections

          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:

          • {!account1} contains field values for the Acme Wireless account
          • {!account2} contains field values for the Global Media account

          Assignment: {!account1} Equals {!account2}

          After the Assignment: both {!account1} and {!account2} contain the field values for the Global Media account

          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.

          Note
          Note Assignments use the stage’s fully qualified name: namespace.flowName:stageName or flowName:stageName.

          $Flow.CurrentStage

          Replace the stage selected in $Flow.CurrentStage.

          Operator Description Supported Data Types Example
          Equals Value replaces the value of $Flow.CurrentStage.
          • Stage
          • Fully qualified stage name

          Before the Assignment: $Flow.CurrentStage is stage1

          Assignment: {!$Flow.CurrentStage} Equals {!stage2}

          After the Assignment: $Flow.CurrentStage is stage2

          $Flow.ActiveStages

          Add or remove active stages in the $Flow.ActiveStages global variable.

          Operator Description Supported Data Types Example
          Add Value is added to the end of $Flow.ActiveStages.
          • Stage
          • $Flow.ActiveStages
          • $Flow.CurrentStage
          • Fully qualified stage name

          Before the Assignment: $Flow.ActiveStages is stage1, stage2

          Assignment: {!$Flow.ActiveStages} Add {!stage3}

          After the Assignment: $Flow.ActiveStages is stage1, stage2, stage3

          Remove After First The first instance of the stage in Value is found within $Flow.ActiveStages. All stages after the first instance are removed from $Flow.ActiveStages.
          • Stage
          • $Flow.CurrentStage
          • Fully qualified stage name

          Before the Assignment: $Flow.ActiveStages is stage1, stage2, stage3, stage4

          Assignment: {!$Flow.ActiveStages} Remove After First {!stage2}

          After the Assignment: $Flow.ActiveStages is stage1, stage2

          Add At Start Value is added to the beginning of $Flow.ActiveStages.
          • Stage
          • $Flow.ActiveStages
          • $Flow.CurrentStage
          • Fully qualified stage name

          Before the Assignment: $Flow.ActiveStages is stage1, stage2

          Assignment: {!$Flow.ActiveStages} Add At Start {!stage0}

          After the Assignment: $Flow.ActiveStages is stage0, stage1, stage2

          Remove All All instances of Value are removed from $Flow.ActiveStages.
          • Stage
          • $Flow.ActiveStages
          • $Flow.CurrentStage
          • Fully qualified stage name

          Before the Assignment: $Flow.ActiveStages is stage1, stage2, stage3

          Assignment: {!$Flow.ActiveStages} Remove All {!$Flow.ActiveStages}

          After the Assignment: $Flow.ActiveStages is empty

          Remove First The first instance of the stage in Value is removed from $Flow.ActiveStages.
          • Stage
          • $Flow.CurrentStage
          • Fully qualified stage name

          Before the Assignment: $Flow.ActiveStages is stage1, stage2, stage3, stage1

          Assignment: {!$Flow.ActiveStages} Remove First stage1

          After the Assignment: $Flow.ActiveStages is stage2, stage3, stage1

          Remove Before First The first instance of the stage in Value is found within $Flow.ActiveStages. All stages before that first instance are removed from $Flow.ActiveStages.
          • Stage
          • $Flow.CurrentStage
          • Fully qualified stage name

          Before the Assignment: $Flow.ActiveStages is stage1, stage2, stage3, stage4

          Assignment: {!$Flow.ActiveStages} Remove Before First {!stage3}

          After the Assignment: $Flow.ActiveStages is stage3, stage4

          Remove Position

          Value specifies a position in $Flow.ActiveStages. The stage at that position is removed from $Flow.ActiveStages.

          Make sure that Value at run time is a positive integer that is within the range of the number of stages in $Flow.ActiveStages.

          Number

          Before the Assignment:

          • $Flow.ActiveStages is stage1, stage2, stage3
          • {!varNum} is 2

          Assignment: {!$Flow.ActiveStages} Remove Position {!varNum}

          After the Assignment: $Flow.ActiveStages is stage1, stage3

          Equals Count The number of stages or collection items in what you enter for Value replaces the value of Variable.
          • Collection
          • $Flow.ActiveStages

          Before the Assignment:

          • {!varNumber} is 0
          • {!collText} is Yellow, Green, Blue

          Assignment: {!varNumber} Equals Count {!collText}

          After the Assignment: {!varNumber} is 3

          Text

          Replace a text resource with a new value (Equals) or concatenate a value onto the end of the original value (Add).

          Note
          Note Before values are assigned or added to a text resource, they’re converted into string values.
          Operator Description Supported Data Types Example
          Equals The text that you enter or select for Value replaces the value of Variable.
          • Boolean
          • Currency
          • Date
          • Date/Time
          • Number
          • Multi-Select picklist
          • Picklist
          • Stage, including $Flow.CurrentStage and $Flow.ActiveStages
          • Text
          • Time

          Before the Assignment: {!varText} is Blue

          Assignment: {!varText} Equals Yellow

          After the Assignment: {!varText} is Yellow

          Add The text that you enter or select for Value is added to the end of Variable.
          • Boolean
          • Currency
          • Date
          • Date/Time
          • Number
          • Multi-Select picklist
          • Picklist
          • Stage, including $Flow.CurrentStage and $Flow.ActiveStages
          • Text
          • Time

          Before the Assignment: {!varText} is Blue

          Assignment: {!varText} Add Yellow

          After the Assignment: {!varText} is BlueYellow

          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:

          {!varTime} is 09:00 AM

          Assignment:

          {!varTime} Equals 09:00 AM

          After the Assignment:

          {!varTime} is 09:00 AM

           
          Loading
          Salesforce Help | Article