Storing Data in Thunkable
As you build your Thunkable apps, you’ll quickly realize that most apps need to remember information. Where do you save a user’s high score? Or their settings? Or a list of information that everyone using the app needs to see?
This is where Data Storage comes in. Today, we’ll explore the different ways you can store data in your Thunkable apps, focusing on two main approaches: storing data Locally (right on the user’s phone) and storing data in the Cloud (online). Choosing the right method is important for how your app works!
Lesson Topic: Storing Data in Thunkable
Section 1: Keeping it Private (Local Storage)
What is it? Saving data directly onto the user’s phone or tablet itself. This data belongs only to that specific user on that specific device.
When to use it?
- When the data is personal to the user and doesn’t need to be shared with others.
- When the app needs to save or access this data even when the phone is offline (no internet connection).
- For simpler data storage needs.
Common Examples:
- User preferences (like theme colour, font size choice).
- Personal high scores in a game.
- Notes or journal entries created by the user.
- Progress saved in a task list or educational module (if only for that user).
- Data downloaded for offline use.
How in Thunkable? The stored variable
- The Tool: Thunkable’s easiest way for local storage is using stored variables.
- How it Works: You create these variables similar to app variables, but you select the ‘stored’ type. Whenever you change the value of a stored variable using the set stored variable… block, Thunkable automatically saves that value onto the device’s memory. When the user closes and reopens the app, the stored variable will remember its last saved value.
- Usage:
- Declare it in the Variables section, choose ‘stored’, give it a name (e.g., stored UserTheme).
- Use the set stored UserTheme to… block to save a value.
- Use the stored UserTheme block (the green variable block) to read the saved value.
- Pros: Simple to use, works perfectly offline.
- Cons: Data is only on that device (not accessible if the user logs in on another phone). Data is usually lost if the user uninstall s the app. Best for relatively simple data (text, numbers, true/false).
(Thunkable also has a Local Table/Local DB component for storing more structured data locally, but stored variables are often sufficient for basic needs).
Section 2: Sharing is Caring (Cloud Storage)
What is it? Saving data online on internet servers (often called “the cloud”).
When to use it?
- When data needs to be shared between different users of your app.
- When a user needs to access their own data from multiple devices (e.g., logging in on phone and tablet).
- When you (the developer) need to manage or update data that all users see.
Common Examples:
- Shared leaderboards for a game.
- A chat feature where messages are seen by multiple people.
- A shared list or directory (like approved clinics, available resources, market prices).
- User accounts and profiles that can be accessed from anywhere.
- Content you update centrally (like daily tips or news).
CRITICAL Consideration for Uganda: Cloud storage requires an active internet connection on the user’s phone to save new data to the cloud or load the latest data from the cloud. If the user is offline, they might only see old, previously loaded data, or they might not be able to save their changes until they reconnect. This is a major factor given that internet access can be unreliable or costly for some users here.
How in Thunkable? Main Options:
- cloud variable (using Firebase)
- The Tool: Variables you declare as ‘cloud’ type.
- How it Works: These variables automatically sync their values with Google’s Firebase Realtime Database online. When one user changes a cloud variable, the change is pushed to the database, and other connected users’ apps will receive the update almost instantly.
- Setup: Requires you to create a free project on the Google Firebase website (firebase.google.com) and then link your Thunkable project to it in the Thunkable Project Settings (using keys/IDs from Firebase). This setup process needs care and following instructions precisely.
- Usage: Use set cloud VariableName to… and get cloud VariableName blocks, similar to other variables.
- Pros: Good for simple shared data, real-time updates.
- Cons: Requires Firebase setup, needs internet, can become less efficient for storing large amounts of structured data (like many rows and columns).
- Data Sources (e.g., Google Sheets, Airtable) with Data Viewer List / Data Viewer Grid
- The Tools: UI components (Data Viewer List, Data Viewer Grid) connected to external data sources.
- How it Works: You store your data in an online spreadsheet (Google Sheets) or a more powerful online database (Airtable – has a generous free tier). In Thunkable, you add this sheet/table as a ‘Data Source’, then link a Data Viewer component to it to display the data in your app as a list or grid.
- Setup: You first need to create and structure your data in Google Sheets or Airtable online. Then, in Thunkable (left panel), add the Data Source, select Google Sheets or Airtable, and follow the steps to connect to your specific sheet/table. Finally, link the Data Viewer component on your screen to this Data Source.
- Usage: Excellent for displaying lists or tables of shared information (e.g., a directory, resource list, news feed). You can also use blocks (like Create Row in Data_Sources drawer, Update Value) triggered by buttons or forms to let users add or edit data directly in the connected Google Sheet/Airtable.
- Pros: Great for structured, shared data. Easy to manage the data directly in Sheets/Airtable. Can handle larger datasets well.
- Cons: Needs internet to load data and save changes. Setup requires creating the external sheet/table correctly.
Section 3: Choosing the Right Storage for Your Feature
Ask these questions for each piece of data your app needs to remember:
- Shared or Private? Does this data need to be seen or modified by other users?
- Shared -> Cloud Storage (cloud variable or Data Source).
- Private -> Local Storage (stored variable).
- Offline Access Needed? Must the user be able to save/load this specific data without internet?
- Yes -> Local Storage (stored variable).
- No (or limited offline use okay) -> Cloud Storage (but think about how the app behaves offline – does it show old data? An error message?).
- Simple Value or List/Table?
- Simple value (like score, setting, status) -> stored variable (local) or cloud variable (cloud).
- Structured list/table -> Data Source (cloud) or potentially Local Table (local, more advanced).
Section 4: Let’s Plan Your App’s Memory (Activity)
Now, think about your Technovation app’s MVP features:
Task: For each feature that needs to save information:
- What data needs saving? (e.g., User’s name, list of reported issues, daily mood entry, game level).
- Local or Cloud? Based on the questions above (shared? offline needed?), decide if it should be stored locally or in the cloud.
- Which Thunkable Tool? Choose the specific component/variable type (stored variable, cloud variable, Data Viewer + Google Sheet/Airtable).
- Make Notes: Write down your decisions and why. Note any setup needed (e.g., “Need Firebase project for cloud variables,” “Create Google Sheet structure for resource list,” “Use stored variable called ‘lastScore'”).
This planning helps you choose the right tools before you start coding the storage parts!
Section 5: Quick Review (Key Concepts)
- Local Storage: Saves data on the device. Private, works offline. Tool: stored variable.
- Cloud Storage: Saves data online. Sharable, requires internet. Tools: cloud variable (via Firebase), Data Sources (via Google Sheets/Airtable).
- Key Considerations: Offline Needs vs. Sharing Needs, Internet Reliability (especially in Uganda!), Setup Complexity.
Conclusion
Webale Kusoma! (Thank you for learning!) Understanding how and where to store data is crucial for building functional apps in Thunkable. Choosing between local (stored variable) and cloud (cloud variable, Data Sources) depends entirely on your app’s specific needs – especially whether data needs to be shared and if offline access is critical for your users here in Uganda. Plan your data storage carefully for each feature! Mugende Mumirembe! (Go in peace!)
STORING LONG TERM DATA
In the last unit, you learned how to use variables and lists to store information in your app.
When the app is closed, all variables stored in the app’s memory are wiped away.
There are times, though that you might want keep track of information between runs of the app. There are two types of long term storage:
Local Storage
Store information on the mobile device to be retrieved each time the app runs.
For example, a user address or high game score.
Cloud Storage
Store information on the web (cloud) so all app users can access the information.
For example, game leaderboard or chat messages.
LOCAL STORAGE
Once the user closes an app, the values of all app variables get erased from the device’s memory.
If you want to store data for the app between runs, you will use stored variables.
Stored variables can be used to store a user’s personal information that does not need to be shared.
For example, the user wants to enter their name, age, address once, not every time they use the app. Another example is tracking something like healthy habits over time. Stored variables are the solution.
Stored variables work just like app variables. Just select stored from the dropdown menu in the initialize block.
With stored variables, there is no initialize value to set it to. The value of the variable will be null, or empty, until it is used in the app, so be careful using it!
You get and set the value of stored variables just like you would an app variable.

CLOUD STORAGE
Cloud Storage allows any user of the app to access and share data. Multiple app users can store and retrieve data found in a database, which is simply a collection of data stored electronically.
Have you ever shared a picture or video on Instagram or TikTok? Apps like these use cloud storage. When your friend uploads and shares a picture, your phone checks the web database for new photos, and then you see it in your feed.
Stored variables
Cloud Storage
Thunkable has several cloud storage options.
Cloud Variables
Data Sources
Cloud variables work just like app and stored variables, except the data is stored in the cloud. Select cloud from the dropdown when you initialize the variable.
Thunkable cloud variables are saved to a Thunkable Firebase database in the cloud. Note that you are sharing this database with other Thunkable coders, so it is recommended you make your own Firebase account if you choose this option.

Mentor Tip


ACTIVITY: STORE GAME SCORES
Estimated time: 60 minutes
Update the Quick Quiz Game to Store High Scores
- Open the starter project in Thunkable.
- Make a copy of the project so you can edit it.
- Follow along with the video below to link a Google Sheet to your app to store and update players’ high scores.
CHALLENGE

Now that you have coded the Quick Quiz game to read, write and update personal high scores, can you:
- Read the high scores of all players and find the highest score of all players
- Report that information to the user
- using a label
- or add it to the Alert message
REFLECTION
As you start to code your own app for your project, consider these questions.

What data will you need to store for your app?
Does it need to be stored
in the app,
on the user’s mobile device,
or in the cloud for sharing
Is it a combination of storage requirements for your app? You can use all 3 options!
What data will you need to store for your app?
Does it need to be stored
in the app,
on the user’s mobile device,
or in the cloud for sharing
Is it a combination of storage requirements for your app? You can use all 3 options!
What data will you need to store for your app?
Does it need to be stored
in the app,
on the user’s mobile device,
or in the cloud for sharing
Is it a combination of storage requirements for your app? You can use all 3 options!
REVIEW OF KEY TERMS
- Database – an organized collection of information
- Cloud Storage – information that is stored on the web so that any device connected to the internet can access it
ADDITIONAL RESOURCES
Here are more documents and tutorials for exploring cloud storage in an app.
- Make a Login and Posting App that uses Firebase and Sign-In, Google Sheets, and Cloudinary to save and share images in the cloud
- Make a Video Posting app
- Build an App that uses a Google Sheet
- Add the Numbers in a Google Sheet