Skip to main content

The localStorage object

Store and retrieve data in the browser.

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.

value

The value.

Type string | number | boolean | object | array
Mutability Read-only

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);