Local Storage: Unclear Documentation

Dear Retool Team,

I wanted to point out that the documentation for Local Storage appears to be missing some key details—particularly around the setValue method.

At the moment, it's unclear how this method should be used. Should we call it like setValue('key', 'value'), use an object syntax like setValue({ key: 'key', value: 'value' }), or pass a complete object with localStorage.setValue(obj)? The latter seems to be implied in the docs, but it’s not stated explicitly. The process for retrieving data isn’t entirely clear either.

Ideally, I would expect it to follow the standard Local Storage interface—i.e. using methods like .getItem() or .setItem(). If Retool introduces its own conventions here, it would help to highlight these differences more clearly in the documentation.

I hope you're able to clarify this section. It would go a long way in making the platform more intuitive for users.

Thanks in advance!
:wave:

Hey @emozio - as far as I know, we haven't built any additional wrapper on top of the native localStorage API, which is probably why our documentation is so light. If nothing else, we can definitely make that more clear or even point users toward pages like the one I've linked above.

I stand corrected! Shows you how often I use localStorage. :rofl: You're right, though - our documentation is plain wrong when it comes to setting values, in particular. I'll ping the team in charge of updating docs.

For the sake of clarity and anybody stumbling across this in the future, the signature of setValue is identical to setItem in the sense that it takes two arguments - a key and value. All data can be retrieved en masse through the values attribute. Note that this is an attribute and not a method.

1 Like