Introduce a Variables Manager for global values across Budibase apps
Description
Introduce data variables in Budibase.
Data variables are named values that can be defined once and reused across components, pages, workflows, and queries. They may be static (hardcoded) or dynamic (derived from queries, user input, or formulas). This creates a single source of truth for values and logic inside an app.
By functioning similarly to how frameworks use scoped variables (e.g. CSS variables in Svelte), developers could reuse values without hardcoding them on each screen or maintaining separate data tables wrapped in provider components.
Use Case
- Store a global variable
companyPhonewith the organization’s main contact number, and reference it across multiple pages (e.g., footer, contact form, support workflow). - Define a global variable
companyNameand reuse it consistently in headers, email templates, and automated messages. - Maintain a global variable
supportEmailthat can be bound to forms, workflows, and notifications without hardcoding the address in multiple places. - Create a global variable
officeAddressand display it across different pages or use it in workflows that generate documents.
Expected Behavior
- Developers can manage variables in a Variables Manager with scope options:
- Global: available across the app
- Page: available only within a page
- Component: local to a component instance
- Variables can hold static values, query results, formulas, or user input.
- Variables update reactively when their source changes.
- Variables can be referenced in bindings and workflows using a simple syntax:
{{ variables.customerName }} {{ variables.orderTotal }} - Variables can be referenced similary to how states can be, but variables are more global and allow reuse and be initially set on app/screen load.
Why it Matters
- Reduces duplication of queries and bindings
- Improves maintainability and readability in complex apps
- Enables modular, reusable logic
- Provides a clear, developer‑friendly way to manage dynamic values
- Aligns Budibase with modern app‑building practices where variables are a core foundation
Example Reference
Comparable functionality exists in other open‑source platforms, where reusable variables have shown to greatly improve developer efficiency and reduce repetitive work. Implementing a similar system in Budibase would deliver the same productivity benefits. As an example, Webstudio is an app that does this: https://docs.webstudio.is/university/foundations/variables
hey @NDCallahan, we have environment variables which might cover most of this functionality. are there any things you can see that this wouldn't cover?
I mean, Not exactly what I'm referring to. It appears Environment Variables for budibase, "provide a mechanism for easily re-using secrets/datasource configuration across different Workspaces, as well as allowing for different values to be used in development apps versus production apps."
What I'm talking about is from a styling perspective. It has nothing to do with values between dev/prod. I'm speaking around, lets say I have a footer at the bottom of my app. It displays information that could potentially be dynamic, like a copyright "Copyright 2025. Company Name". By allowing data variables, we can define them something to the effect of "company.Name", where that value is set one single time, and we call it to display similarly to how we do other bindings.
Currently, the workaround this is to create a dataset in a table and use it that way.
Also - Even if Environment Variables were the way to go, it's behind the Enterprise plan which is above the already unreachable premium plan when speaking from a small business, not an enterprise perspective.