Looker template variables
Use template variables to create dynamic, reusable dashboards with the Looker data source.
Before you begin
Before you create a variable, ensure you have:
- Configured the Looker data source.
- A basic understanding of Grafana template variables.
Supported variable types
The Looker data source supports the following Grafana variable types:
Query variable types
When you create a query variable with the Looker data source, select one of the following Query Type options:
Create a query variable
To create a query variable:
- On the dashboard, click Edit to enter edit mode, then go to Options > Variables.
- Click Add variable.
- Enter a Name for the variable.
- Select Query as the variable type.
- Click Open variable editor.
- Select the Looker data source.
- Select a Query Type and complete the fields it requires.
LookML models
The LookML models query type takes no additional fields. It returns the models available to the data source, so you can drive other variables or queries by model.
LookML models explores
The LookML models explores query type requires a LookML Model. It returns the explores available within the selected model.
LookML dimension values
The LookML dimension values query type returns the distinct values of a dimension. Complete the following fields:
Looks
The Looks query type takes no additional fields. It returns the saved Looks available to the data source. The variable value is the Look ID and the display text is the Look title, so you can build a variable that selects a Look by name.
Create dependent variables
You can chain variables so that one updates based on another. When you build a LookML models explores variable, set its LookML Model to a model variable, such as ${model}. The explore list then updates whenever the selected model changes.
Use variables in queries
Caution
Referencing template variables inside a Looker panel query isn’t supported. Although the query builder drop-downs may list your dashboard variables, the data source doesn’t substitute them when the query runs, so Looker receives the variable reference unresolved. This applies to the builder, the LookML JSON body, and the filter expression.
You can still use Looker variables in the standard Grafana ways:
- Repeat a panel or row for each selected value.
- Reference the values in panel titles, text panels, or queries to other data sources.
For more information, refer to Grafana template variables.


