---
schema_version: "1"
id: bbb40e5d85ab61b8fcb361da8c119ca3f8894139984d3afe5975a5d653bdc4c8
title: Set Variable
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/rpa-builder/latest/toolbox-variable-handling-set-variable.md
canonical_url: https://docs.mulesoft.com/rpa-builder/latest/toolbox-variable-handling-set-variable
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 82f7d8e61dbc7081cc7eb53a4538d69154b412a1f1abe7fdd8e28d73a5ea7bae
description: MuleSoft Documentation Site
release: "6.7"
latest: true
---
---
product: RPA Builder
version: 6.7
is-latest-version: true
---

# Set Variable

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

The _Set Variable_ action step assigns a new value to a variable. You can either enter the new value
directly or use an existing variable of the same type, e.g. the input variable of another action
step. The variables must be of the same type in order to populate one variable with the content of
another variable, e.g. you can only populate a variable of type:Text with another variable of
type:Text In order to ensure that the types are the same, this action step has to be configured in
several stages (see step-by-step instructions for the wizard below). Validation of variable types is
performed when the action step is launched.

Variables from the _BasePath_ **cannot** be modified using the _Set Variable_ action step.
Attempting to do so will generate an error message.

Changes to a variable are logged in the _Workflow Run Results_. The logs record both the old and new
values of the variables. Variable values that are longer than 16 characters are shown in truncated
form.

## Properties

**Common**

- **New value** Enter the new value for the variable to be modified. This field is only displayed
  when the new value is being entered manually. If the new value is based on another variable, the
  field is not displayed.

Other properties that are the same in all action steps are described in section 2.2. For reasons of
clarity they are not shown here.

## Wizard

- **Variable** The field displays the variable that will be overwritten with _Value_ as well as the
  variable’s type. If "No Variable is mapped…" is displayed, this means that no variable has been
  set using the _Mappings Editor_ (in this case, proceed as described in the step-by-step
  instructions below).

- **New value** Enter the new value for the variable to be modified. You can also insert variables
  from the workflow.

Variables from the _BasePath_ **cannot** be modified using the _Set Variable_ action step.
Attempting to do so will generate an error message.

## Step-By-Step – Configure Set Variable as Follows

1.  Drag the _Set Variable_ action step to the desired position in the workflow.

2.  Open the _Set Variable_ wizard.

3.  Enter a new value for the variable to be changed in the _Value_ field. You can also insert
    variables from the _Workflow_. To do so, click the pin button and select one of the available
    variables.

4.  Click on the pin in the _Set Variable_ action step in the _Workflow_.

5.  In the "Edit Variable Mappings for …" dialog, select the variable that you wish to modify from
    the "Variable" drop-down menu. The drop-down menu will only show variables that are of the same
    type.  
    Use the "New value" drop-down menu to set the new variable to the value of another variable.
    This menu also only displays variables that are of the same type. To use the value specified in
    the wizard, leave the <None> option in the drop-down menu.  
    Confirm your selection with OK.

6.  The pin for the _Set Variable_ action step will now be shown in red.

7.  As an extra check, open the _Set Variable_ wizard. The "Variable" field should now show the
    variable to be changed, followed by its type in brackets.
