localStorage doesn't work

Share data between classic app pagesl

I have a button that sets a “reviewed” status on certain events within a page. I am saving this value to localStorage, but it is removed every time the page or table refreshes. My users’ workflow necessitates the table refreshes automatically every 60 seconds, making the feature unusable.

Summary

In a classic app, a button writes a 'reviewed' status to localStorage, but the stored value is wiped every time the page or the table refreshes — and because the table auto-refreshes every 60 seconds, the persisted status never survives.

AI Response

In Retool, values written with localStorage.setValue() are saved to the browser and are designed to survive page and component refreshes, unlike Variables/temporary state which reset on load. When a localStorage value appears to disappear on refresh, the usual cause is app logic (a query or JS running on page/table load or on the auto-refresh cycle) re-initializing or overwriting that same key back to an empty/default value rather than the refresh clearing it. Audit anything that runs on load or on the 60-second refresh — including queries with 'Run on page load', transformers, or JS steps in the table's refresh chain — and add a guard so the key is only initialized when it doesn't already exist. Confirm the write path uses a distinct, stable key and that nothing resets that key on the refresh trigger.

Sources

:bookmark: Local storage value changing on its own
A solved report of a localStorage value being unexpectedly wiped/changed, matching this behavior and pointing to logic that overwrites the key rather than the refresh itself.
:bookmark: Store temporary data with variables and localStorage | Retool Docs
Official guide confirming localStorage persists to the browser (versus Variables/temp state that reset on load), which supports checking for on-load/refresh logic that re-initializes the stored value.

The Community Team is testing out a new automation. Let us know if it's helpful (or not) by leaving a :heart:, :+1:, or :-1:. Or by marking this post as the "Solution"! Let us know if you have any feedback here. :rocket: