One of the most frustrating parts of using Metabase for serious dashboards is managing SQL query variables manually.
A common case: you have a dashboard with several SQL questions, and they all use the same filters — for example company_name, bill_date, customer, category, etc.
Right now, every variable needs to be configured manually.
This becomes painful very quickly.
If I change or add something in a dashboard with 5–10 SQL questions, I often need to repeat the same configuration again and again. It is error-prone, slow, and frankly one of the least pleasant parts of working with Metabase.
What I would love to have is a way to bulk-edit or import variable settings, for example by pasting a JSON configuration that maps variables to tables, fields, widget settings, labels, and other parameters.
Something conceptually like:
{
"company_name": {
"type": "field_filter",
"table": "bexio_marts.mart_invoices",
"field": "company_name",
"widget_type": "dropdown",
"label": "Company Name",
"multiple_values": true
},
"bill_date": {
"type": "field_filter",
"table": "bexio_marts.mart_invoices",
"field": "bill_date",
"widget_type": "date",
"label": "Bill Date"
}
}
I also opened a dedicated GitHub issue for this feature request:
opened 10:56AM - 04 Jun 26 UTC
Related Discourse discussion: https://discourse.metabase.com/t/metabase-needs-a-… better-way-to-bulk-manage-query-variables/308445
## What problem will this feature request solve?
Managing SQL query variables manually becomes very painful when building serious dashboards with multiple SQL questions that reuse the same filters.
A common case is a dashboard where several SQL questions all use the same variables, for example:
- `company_name`
- `bill_date`
- customer filters
- category filters
- other repeated dashboard-level filters
At the moment, each variable has to be configured manually in each SQL question:
- variable type
- mapped table
- mapped field
- table and field alias
- widget type
- widget label
- dropdown/search/input behavior
- single-value vs multiple-value behavior
This is slow, repetitive, and error-prone.
The problem becomes worse when a dashboard contains 5–10 SQL questions using the same filters. Any change to the variable configuration often has to be repeated manually across multiple questions.
## Describe the solution you'd like.
I would like a way to bulk-edit, import, export, or reuse SQL query variable settings.
One possible solution would be a JSON-based import/export UI for variable configuration, where users could paste or edit a structure that maps variables to tables, fields, widget settings, labels, and other parameters.
Conceptually, something like:
```json
{
"company_name": {
"type": "field_filter",
"table": "bexio_marts.mart_invoices",
"field": "company_name",
"widget_type": "dropdown",
"label": "Company Name",
"multiple_values": true
},
"bill_date": {
"type": "field_filter",
"table": "bexio_marts.mart_invoices",
"field": "bill_date",
"widget_type": "date",
"label": "Bill Date"
}
}
```
Alternative or complementary solutions could be:
- reusable variable presets
- dashboard-level variable schemas
- copying variable configuration from one SQL question to another
- bulk editing variables across multiple SQL questions in the same dashboard
- exposing variable configuration more directly through the UI/API
Example query:
```sql
SELECT
company_name,
customer_name,
COUNT(DISTINCT document_nr) AS count_invoices,
SUM(total_net) AS net_total,
COALESCE(
1 - SUM(total_net) / NULLIF(SUM(total_gross), 0),
0
) AS VAT,
COALESCE(
SUM(total_net) / NULLIF(COUNT(DISTINCT document_nr), 0),
0
) AS avg_invoice_value
FROM bexio_marts.mart_invoices
WHERE {{company_name}}
[[AND {{bill_date}}]]
GROUP BY
company_name,
customer_name
ORDER BY net_total DESC;
```
In this example, `company_name` and `bill_date` are variables that may be reused across many SQL questions in the same dashboard. Having to manually remap and reconfigure them every time is unnecessarily tedious.
## How does this feature request impact you?
This is more than a minor inconvenience.
It slows down dashboard development, especially when building dashboards with several SQL questions that share the same filters. It also increases the risk of inconsistent variable mappings, wrong widget settings, or missed updates when the dashboard changes.
For teams building many dashboards with repeated SQL filters, a bulk-management workflow would save time and reduce mistakes.
## Additional information
The current UI is clear for configuring a single variable, but it does not scale well when the same configuration needs to be repeated across many SQL questions.
A reusable or bulk-editable variable configuration would make SQL-based dashboards much easier to maintain.