How do I get access to LocalStorage?

My kid is trying to build a multi-screen app with information conveyed across pages. Let’s say we want three screens: on the first screen you enter a number (call it N1), second screen you enter N2, and third screen you print the N1+N2. (Please don’t nitpick the example. Of course we can put them all on one screen. The underlying information-flow issue is what matters.)

Navigating between screens is of course easy. The problem is with persisting information. We tried variables, but they appear to be local to screens. Searches suggest that AppEngine has a notion of a global variable, but that doesn’t seem to be in Thunkable X.

She isn’t ready to create an account on a system like Firebase, nor does it appear necessary, given that there’s the Local Storage option, which sounds just right:

https://docs.thunkable.com/thunkable-cross-platform/create/components/data/local-storage

My problem is simply that we can’t find any Local Storage blocks anywhere. I’m pretty certain she and I have both searched through all the drawers and haven’t found it. We’ve even clicked on individual page elements to see if they’re hiding in there, and they’re not. [Not that a Firebase or other account would help, since there are no blocks for those either.]

I presume we have to do something to “enable” Local Storage. What/where/how? The documentation page above is (frustratingly) silent on where these blocks actually reside or what one needs to do to make them manifest.

Under “Components” on the left side of the “Design” tab you’ll find a section called “Data”. Here is “Local Storage” (the icon look like a stack of discs). Drag that to your “Invisible Components” section.

Now, you can access the “Local Storage” Save, Get, and Remove methods in the block screen by selecting the “Local_Storage1” block (presuming you didn’t rename it).

I hope this helps,
Steven

P.S. Visible vs. Invisible components talks about the components. Visible you know (buttons, labels, etc.).

2 Likes

Thank you for your help. Not sure why I didn’t think to look there, but I didn’t, and that was what I needed.

(Sadly, there seems to be a problem with actually using the API, but I’ll post about that separately since it’s a distinct issue.)