Skip to main content

The localStorage object

Classic apps

You're viewing documentation for classic apps, which use Retool's original app editor. The new app builder is the recommended way to build apps and where Retool focuses new development.

Use localStorage to save data locally to the browser.

Properties

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

values

The value.

Type string | number | boolean | object | array
Configurability Read-only
Defaultnull

Methods

JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.

localStorage.clear

Clear all values.

Definition
localStorage.clear()
Examples

Clear the value of localStorage.

localStorage.clear();

localStorage.setValue

Set the current value.

Definition
localStorage.setValue(value)
Parameters

value

The value.

Type string | number | boolean | object | array

Examples

Set the current value of localStorage to userValue.

localStorage.setValue(userValue);