Links

Local Storage

Using localStorage

localStorage is permanent browser storage, which is available across all browser tabs of your application and after the page refresh. You can find more details about it here.
localStorage can be used as a temporary storage in the following cases:
  • the data needs to be saved after a page refresh;
  • the data needs to be available across all browser tabs.
To save the data to the localStorage, use the action Save to Local Storage, and assign your variable a name. To use the data from it, use {{localStorage.varName}}, where varName is the name of the variable used in the action.

Use case: saving a draft message

Let's check the localStorage usage on a simple example. We will add a text area component and save a draft of the message so that it's not lost upon a page refresh or when a user closes the app.
  1. 1.
    Start with adding a text area component onto the working area.
  2. 2.
    Next, add a new action - Save to local storage. Specify the variable name and the value, and assign the action to the OnChange trigger of the text component
3. Finally, assign the localStorage variable to the Value filed of the text: