Javascript Not Working 123

I have some javascript code which I need to get a value from local Storage as below:

mCONTINUE = localStorage.getItem('mContinue');

This code generates an error message

localStorage.getItem is not a function

What is wrong with this code?

Mike

Hello @mdsmith1

To store a value in Retool localStorage, you can use localStorage.setValue(value).
To retrieve the stored value from localStorage in Retool, you have to use localStorage.values.

Yes, it works.

mCONTINUE = localStorage.values.mContinue;
console.log(mCONTINUE equals ${mCONTINUE});

Thank you very much.

I will mark it as the solution.

Mike

1 Like