Thunkable Docs
Build an AppDrag and Drop DocsSnap to Place DocsAcademy
Drag and Drop
Drag and Drop
  • What is Thunkable?
  • 🗺️Getting Started
    • Gen AI
    • Getting Started Guide
    • Keyboard Shortcuts
    • Undo Redo
    • Thunkable Account
      • Account Management
    • Preview and Test your App
    • Versioning
    • Data Sources
      • Google Sheets Data Source
      • Airtable Data Source
      • Webflow Data Source
      • Local Table Data Source
    • Project Collaboration
      • Organizations
    • 🎓Sample Apps & Tutorials
      • Thunkable Community Forums
      • Sample Apps
      • Video Tutorials
        • Thunkable Live App
          • How to Test and Troubleshoot with Thunkable Live App
        • Data Source Tutorials
          • Connecting to Data Sources
            • Google Sheets
            • Local Table
          • Create Data in a Thunkable Data Source
          • Read Data in a Thunkable Data Source
          • Update Data in a Thunkable Data Source
          • Delete Data in a Thunkable Data Source
        • User Auth & Management
          • Firebase
            • User Sign-Up, Sign-In, and Auth
            • User Sign Out and Password Reset
          • Google
            • User Sign-Up, Sign-In, Sign-Out, and Auth
          • Apple
            • User Sign-Up, Sign-In, Sign-Out, and Auth
        • Projects
          • How to Save Versions of Your Thunkable Project
          • How to Copy and Customize Public or Sample Thunkable Projects
        • User Interface & Design
          • Screens
            • Save and Reuse Thunkable Screens
            • Change Thunkable Screens with a Button Click
            • Create Scrollable Screens in Your Thunkable App
          • Navigators
            • How to Use the Thunkable Stack Navigator
            • How to Use Thunkable Top and Bottom Tab Navigators
            • How to Use the Thunkable Drawer Navigator
            • Combine Figma Frames with Thunkable Navigators
          • Components
            • How to Use the Visibility Property to Create Modals in Thunkable
          • Data Visualization
            • Customize a Data Viewer
          • Text
            • Implement Text Input Validation
        • Alerts & Notifications
          • Display Alert Messages in Your Thunkable App
          • How to Create Three-Button Alert Messages
        • Files
          • Cloudinary
            • Store and Access Cloudinary Files in Your Thunkable App
        • Camera
          • How to Use the Device’s Camera
          • How to Use the Device’s Video Camera
          • Use the Device’s Camera as a QR or Barcode Scanner
        • Realtime Databases
          • Firebase
            • How to Read Data in a Firebase Realtime Database
            • How to Update Data in a Firebase Realtime Database
        • Advanced Blocks
          • Connect Your Thunkable App to a Web API
        • Thunkable Academy
          • Building Your First Thunkable App
            • Getting Started with Thunkable
            • How to Design a Thunkable App
            • How to Connect a Thunkable App to a Data Source
            • How to Make A Thunkable App Interactive with Blocks
          • Thunkable No Code App Creation Basics
            • Thunkable UI Components and App Features
            • Understanding Thunkable's Drag and Drop Block Builder
            • Design, Develop, Debug, and Deploy Your App
        • Hour of Code
          • 2021 - Build an Informational App
          • 2022 - Build a Scavenger Hunt App
          • 2023 - Build a Translator and Text-to-Speech App
        • App Building
          • How to Build a Translation App in Thunkable
          • How to Create an Image Recognition App with Thunkable
          • How to Create a Text-to-Speech App in Thunkable
  • 🎨App Design
    • User Interface (UI) Components
      • Basic Components
        • Button Component
        • Label Component
        • Rich Text Component
        • Image Component
        • Text Input Component
        • Layout Component
        • Group Component
      • Data Components
        • Simple List Component
        • Data Viewer Components
          • Data Viewer List Component
          • Data Viewer Grid Component
          • Custom Data Viewer
      • Input Components
        • Switch Component
        • Slider Component
        • Checkbox Component
        • Date Input Component
        • Time Input Component
      • Media Components
        • Animation Component
        • Video Component
        • Loading Icon Component
      • Embed Components
        • Web Viewer Component
        • Map Component
        • Canvas Component
        • PDF Reader Component
        • Rating Component
      • Modules
        • Introduction
        • User Guide
      • Generative AI
    • Screens
      • Save and Reuse Screens
      • Improve Thunkable Load Time
    • Navigators
      • Top Tab Navigator
      • Bottom Tab Navigator
      • Drawer Navigator
      • Stack Navigator
    • Figma Integration
  • 🛠️Blocks
    • Thunkable Blocks Overview
    • Core Blocks
      • Control Blocks
      • Logic Blocks
      • Math Blocks
      • Text Blocks
      • Lists Blocks
      • Color Blocks
      • Device Blocks
      • Objects Blocks
      • Variables Overview
        • Connect a Firebase Realtime Database
        • Variables Blocks
      • Functions Blocks
    • App Features Blocks
      • Speech Blocks
      • Sound Blocks
      • Share Blocks
      • Camera Blocks
      • Files Blocks
      • Sign In Blocks
        • User Sign Up, Sign In, and Authentication with Firebase
        • User Sign Up, Sign In, and Authentication with Google
        • User Sign Up, Sign In, and Authentication with Apple
      • Location Blocks
      • Push Notification Blocks
      • In-App Purchase Blocks (with RevenueCat)
      • Data Sources Blocks
      • Alerts Blocks
      • Timer Blocks
      • Sensors Blocks
        • Gyroscope
        • Magnetometer
        • Accelerometer
        • Location Sensor
      • Ads by AdMob
    • Advanced Blocks
      • Web APIs Blocks
        • CORS Policy
        • 🆓No Auth APIs
          • Update Data in a Data Source
          • CRUD Operations
          • Setting Headers
        • 📊Charting APIs
          • Create a chart template
          • Charting in Thunkable
      • Bluetooth Low Energy Blocks
      • OpenAI Services ChatGPT Integration Blocks
      • "Any Component" Blocks
      • JavaScript Web Bridge
  • ⚙️Settings
    • App Settings
      • Tablet View
    • Assets
    • Cloud Variable Viewer
    • Manage your Projects
      • My Projects Page
      • Thunkable Projects
      • Duplicate Project
      • Share Your App
      • Download Your App
        • Download Your App on iOS
        • Download Your App on Android
      • Add to Home Screen
      • Managing Project Storage
      • App Data Privacy
      • Delete Project
  • 📱Publishing
    • Overview
    • Publish to the Apple App Store
      • User Guide
      • Troubleshooting
      • Review Process
      • Tracking Usage Description
    • Publish to Google Play Store
      • User Guide
      • Troubleshooting
      • Review Process
    • Publish as a Web App
      • User Guide
      • Custom Domains
      • Troubleshooting
    • Testing
      • Testing on iOS via TestFlight
      • Testing on Android
    • Troubleshooting
      • Publishing Checklist
      • Generate Screenshots
  • 🎮Gaming
    • Gaming Overview
      • Canvas Label
      • Sprites
      • Sprite Gallery
    • Gaming Blocks
      • Events
      • Motion
      • Looks
      • Direction
      • Sensing
      • Add & Remove
      • Stage
  • 🗃️Additional Resources
    • Release Notes
      • Release Notes 2025
      • Release Notes 2024
      • Release Notes 2023
    • Troubleshooting
      • Can't Sign in to Thunkable?
      • FAQs
    • Minimum Requirements
    • Bugs and Product Feedback
    • App Services and Emulators
Powered by GitBook
On this page
  • Overview
  • Variable Types
  • App Variables
  • Video Tutorial
  • Stored Variables
  • Video Tutorial
  • Cloud Variables
  • Video Tutorial
  • Firebase Realtime Database
  • Cloud Variables and Data
  • Statically vs Dynamically Named Variables
  • Statically Named Variables
  • Dynamically Named Variables
  • Related Docs

Was this helpful?

Export as PDF
  1. Blocks
  2. Core Blocks

Variables Overview

PreviousObjects BlocksNextConnect a Firebase Realtime Database

Last updated 1 year ago

Was this helpful?

Overview

Variables are placeholders that store and manage different types of information, like numbers or text. They allow you to work with dynamic data throughout the app's blocks, enabling functionality such as displaying real-time information or tracking user interactions.

Variable Types

Thunkable supports three types of variables: app, stored, and cloud.

Variable Type
Description
Data Type
Example

App Variables

Store data within an app session and are reset when the app is closed and re-opened.

Works for any data type.

The user's current score in a single-session game.

Stored Variables

Store data on the device. This data is saved between app sessions, so is suitable for data that you want to save long-term.

Works for any data type.

If your app offers multiple languages, the language your user wants to view content in.

Cloud Variables

Store data in the cloud in a Firebase database. This data can be accessed from multiple devices. Suitable for data your user may want to access from multiple devices.

Data must be stored as a string.

In a collaborative app where multiple users share information, game scores, or chat messages across different devices or users accessing the same application.

Variable names can only contain alphanumeric characters and underscore. Invalid characters may cause your app to crash.

App Variables

  • Store data within an app session and are reset when the app is closed and re-opened.

  • Work for any data type.

  • Example: The user's current score in a single-session game.

Video Tutorial

Stored Variables

  • Store data on the device. This data is saved between app sessions, so is suitable for data that you want to save long-term.

  • Work for any data type.

  • Example: If your app offers multiple languages, the language your user wants to view content in.

Video Tutorial

Cloud Variables

  • Store data in the cloud in a Firebase database. This data can be accessed from multiple devices. Suitable for data your user may want to access from multiple devices.

  • Data must be stored as a string.

  • Example: In a collaborative app where multiple users share information, game scores, or chat messages across different devices or users accessing the same application.

Video Tutorial

Firebase Realtime Database

Cloud Variables and Data

To save a list as a cloud variable, use the "make text from list" block to convert the list to a piece of text.

When you retrieve this text from your cloud variable, you can convert it to a list with the "make list from text" block to work with it as a list in your app.

Statically vs Dynamically Named Variables

Statically Named Variables

A statically named variable is fixed. The value will likely change, but the name is constant.

You can initialize (create) variables with static names using the "initialize variable to" block. Initializing an app variable requires you to define an initial value. Stored and cloud variables initialize with null values.

Dynamically Named Variables

A dynamically named variable is one whose name is determined or created while the app runs rather than being predefined or fixed in the blocks. This allows you to generate variable names based on certain conditions, user inputs, or other dynamic factors. These variables do not need to be initialized.

You can use text or other variables to set the name of these variables.

Dynamically named variables are helpful if you don't know what the name of this variable will be during app runtime. For example, you can save data related to a user account under the user's user ID. The user ID is generated when the user signs in to your app.

Related Docs

By default, cloud variables are saved to the Thunkable default Firebase database, but we recommend you save them to your own private Firebase Realtime Database. Learn more here: .

You can only save a piece of or an as a cloud variable.

To save media as a cloud variable, use the block to upload it to Cloudinary and get a URL that points to it. You can save this URL as a cloud variable.

🛠️
Connect a Firebase Realtime Database
text
object
Connect a Firebase Realtime Database
Variables Blocks
Upload File