# Update custom variable

Node type `browser_updateCustomVariable`

## What it does

Set a variable declared by the workflow's start node.

## Desktop client configuration

![Update custom variable configuration in the desktop client](/assets/update-custom-variable.71f0bdfd708dbd0f3bdbf0cfec19e71139643c91b7265c3079cda141b7568299.0538f3a9.webp)

Captured in the English interface of MoreLogin Desktop V2.73.101.

## Inputs

These fields belong in `data.browserUi.inputs`.

| Field | Type or values | Schema required | Execution default | Description and bounds |
|  --- | --- | --- | --- | --- |
| `variableId` | `string` | No | — | Custom variable. Editor initial value `""` |
| `operation` | `"assign"` / `"add"` / `"subtract"` / `"appendText"` / `"push"` / `"concat"` / `"removeAt"` / `"merge"` / `"removeKey"` / `"toggle"` (supports variable references) | No | `"assign"` | Update method. Editor initial value `"assign"` |
| `value` | `["null","boolean","number","string"]` / array<`JSON`> / `object` (supports variable references) | No | — | Update value |


## Mode requirements and limits

- The node updates the variable's current value. Each whole-workflow run starts from the initial values of customVariables in the start node. Number/text/array/object/boolean updates must match the variable type.
- Validation code `RPA_NODE_INPUT_INVALID`


## Input references

| Field | Allowed forms |
|  --- | --- |
| `variableId` | `literal` |
| `operation` | `literal`, `template` |
| `value` | `literal`, `template` |


## Outputs

| Output field | Type or values |
|  --- | --- |
| `previousValue` | `["null","boolean","number","string"]` / array<`JSON`> / `object` |
| `value` | `["null","boolean","number","string"]` / array<`JSON`> / `object` |


Reference published fields as `${nodeId.data.field}`.

## JSON example

A complete node object for a workflow's `nodes` array or another node's `blocks`. The `attempts` custom variable is declared in `start.data.customVariables`.

```json
{
  "id": "count_attempt",
  "type": "browser_updateCustomVariable",
  "data": {
    "title": "Add one to the attempt counter",
    "browserAction": "updateCustomVariable",
    "browserUi": {
      "inputs": {
        "variableId": "attempts",
        "operation": "add",
        "value": "1"
      }
    }
  }
}
```

[Back to the node catalog](/browser-rpa/nodes)