ToolJet/docs/docs/actions/set-localstorage.md
Shubhendra Singh Chauhan 307c2cd05a
[docs] updated sidebar and improved hierarchy (#2958)
* added pages for directories and updated sidebar

* added notion and openapi in sidebar.js
2022-05-04 08:10:46 +05:30

1.3 KiB

id title
set-localstorage Set localStorage

Set localStorage

This action allows you to specify a key and its corresponding value to be stored in localStorage.

Example: App that stores a name in localStorage and displays it on reload

  1. Add an input field, button and a text as shown Set local storage sample app

  2. Select the button and add a Set localStorage action with key set to name and value pointing at the value of the text field Set local storage sample app

  3. Select the text label we've added and set its value to the name item from localStorage Set local storage sample app

  4. Now save the application, this is important as we're about to reload the page.

  5. Type in anything you wish on the input box and click on the button Set local storage sample app

  6. Reload the page, you'll see that the value stored in local storage is persisted and it is displayed on screen! Set local storage sample app