Skip to main content

The Variable object

Variables that store temporary state.

Each instance has a unique name with which to reference (e.g., myVariable1.value).

Properties

All properties for Variable with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read property values.

id

string

The unique identifier.

The value.

Methods

JavaScript API methods for interacting with Variable. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.

setIn

Set the value of a nested key.

await variable.setIn(setInOptions)
Parameters

setInOptions

object

The value and key-path in which to set.

Properties

keyPath

string[]

A list of key-value pairs stored in the variable.

The value.

setValue

Set the current value.

variable.setValue(value)
Parameters

The value.