Appearance
Academy
Want to learn the essentials of WeWeb? Check out our Build a Proof of Concept course for an introduction to the WeWeb editor and how to work with data effectively.
Intro to variables ​
Variables are containers that store information in your WeWeb application. Think of them like labeled boxes where you can keep different types of data - text, numbers, lists, or even yes/no values. Just like how you'd label a box "Kitchen Items" to know what's inside, you give each variable a name to easily find and use its contents anywhere in your application.
For example, if you store the name "John Doe" in a variable called userName, you can display or use "John Doe" anywhere you need it on your website.
Check out this video to learn more about variables in WeWeb:
Create a variable ​
Let's take a look at each step:
- Click on the
Variablestab in theInterfacesection - Click
Add Variableto create a new variable - Name your variable
- Choose the variable type from the dropdown menu (e.g., Text, Number, Boolean, Query, etc.)
- Optionally, you can set a default value for the variable in the
Default valuefield - Decide if you want the variable to be preserved on navigation and/or saved in local storage
- Click
Saveto create the variable
Now, you can use this variable throughout your website by binding it to UI components or using it in workflows.
Variables types ​
In programming, variables are helpful to store, send, and display information. For example, you can store the name of a user in a Text variable (also called a string) or a list of users in an Array variable in your interface before sending the information to the Data & API tab.
However, if you try to send the value of a Text variable to a column that expects an Array, you'll get an error.
That's why it's important to understand the different data types you may encounter in web development.
Text ​
A text variable is a variable that stores text. You can use text variables to store text values, such as names, addresses, or any other text data. It's equivalent to a string in JavaScript.
Number ​
A number variable is a variable that stores numbers. You can use number variables to store numeric values, such as prices, quantities, or any other numeric data. It's equivalent to a number in JavaScript.
Boolean ​
A boolean variable is a variable that stores a boolean value (true or false). You can use boolean variables to store boolean values, such as a flag that indicates whether a user is logged in or not. It's equivalent to a boolean in JavaScript.
Object ​
An object variable is a variable that stores an object. You can use object variables to store complex data, such as a user profile, a product, or any other data that has multiple properties. It's equivalent to an object in JavaScript.
Array ​
An array variable is a variable that stores an array. You can use array variables to store a list of values, such as a list of products, a list of users, or any other data that has multiple values. It's equivalent to an array in JavaScript.
Query ​
You can use query variables to store the value of a query string parameter in an URL.
For example, you can use them to:
- Customize what a user sees based on how they got to your site (like showing different content when they click an email link)
- Remember which product someone wants to view (like going directly to a specific item when sharing a link)
- Keep track of where visitors came from (like knowing if they clicked an Instagram ad)
- Show personalized messages (like displaying "Welcome back!" when someone returns through a special link)
Inspect current value of variables ​
You can view and edit the current values of all your variables in real-time using the Variables tab in the Debug panel. This is especially useful for testing different scenarios and troubleshooting your application.
Learn more about viewing and editing variables in the Debug panel →
Utilizing variables in logic ​
CONTINUE LEARNING
The real power of variables comes in the ability to use them in bindings to create custom logic in your project:

