With field variables, you can use values from fields of an object and related objects in actions such as Mass Update, Create Tasks, and Find & Replace. Even though you are performing a bulk action, variables let you use the different values of a field on each record.
Variables will look up values in fields, and upon execution of the action will enter those values at the spot where the variable is placed. Until then they will show as a placeholder that tells you from which field the value will be copied. Those fields are located on the same object as the target field, or, in some cases, on a related object.
For example, you can enter the variable {!FirstName} in a field. Upon execution of the action, on each record that is processed by the action, the value from that record's First Name field is copied to the field where you placed the variable.
You can use multiple variables in one target field. This way you can create texts that are specific for each record, such as a personalized message on a task.
Example
For example, use variables in the Comment field in a Create Tasks action to address the object owner and show record-specific object details. Say you want to create tasks for the owners of a number of contacts. When you enter the following text in the Comment field:
Upon execution of the action, the values of these fields on each record are then entered in the Comment field of the created task for that record. So for a certain task, the comment could look like this:
Fields that accept variables
Fields that accept variables are indicated by an information icon, that upon hover tells you that you can use variables here:
or by the </> Insert Field Variable button right below the field.
Fields that have a variable information icon can accept variables of the same object only. In these fields, you type the code and field name in order to enter the variable. A variable always consists of the API name of the source field, enclosed by curly brackets and an exclamation mark, e.g. {!FirstName}. Find the API names of all fields by navigating to an object on the Salesforce Object Overview page.
In fields that come with an </> Insert Field Variable button, you can insert variables for fields from the same and related objects. The </> Insert Field Variable button opens a menu to select fields from the current object, or related objects (recognizable by the chevron behind it). If you click on a related object, it will open a menu to select fields from that object, or objects related to that object (up to 5 objects deep).
Inserting variables with the </> Insert Field Variable button
In a field that has the </> Insert Field Variable button right below it:
- Place the cursor at the spot where you want to insert values from other fields. This can also be within an existing text.
- Click the </> Insert Field Variable button below.
- Scroll down or search for the field or object that you want to use a variable for.
- Click on the field you want to use.
The field variable is now inserted in the field. Repeat to add more variables.
Inserting variables in same-object variable fields
In a field that has an info icon text next to the field name, stating “You can use a field variable from this object, like {!Company} or {!FirstName}”:
- Place the cursor at the spot where you want to insert values from other fields. This can also be within an existing text.
- Type the variable name, e.g. {!FirstName}.
That is all there is to it! Fill out the rest of the action, and upon execution the first name as stated on each record will be copied to the field where you entered the variable.