Dashboard template parameters
Authoring tools can mark parts of a query with ${name} so one saved query can be reused with different concrete values. Template holes are allowed only for linting and type-checking against a catalog: you must substitute real literals and table paths before translation or execution.
Syntax
- Expressions: use
${param}like a leaf (similar to a field reference), for exampleWHERE region = ${region}orWHERE timestamp > now() - ${lookback}. - Timestamp truncation units: use
@${param}immediately after an expression whenparamis anintervalprimitive, for exampletimestamp @${timeslice}. - Table paths: each dot-separated segment can mix literal identifier text and parameters, for example
logs.${env}_eventsordb.${which}. An optional space prefix uses a single colon before the path:other:${env}.eventsor${space}:signals.events(see Spaces and dataset references).
Parameter names follow the same rules as unquoted simple identifiers.
Parameter kinds
Declare parameters in template_parameters (or the editor equivalent):
| Kind | Purpose | Example value |
|---|---|---|
primitive | Substitutes as a typed literal in expressions (and in @${name} when the type is interval) | "us", 42, true, interval "1h" |
identifier_fragment | Substitutes into table path segments; typed as string in expressions | "events_prod" |
Interval primitive
Use primitive with "type": "interval". Values must be valid Hamelin interval literals (1h, 7d, 15min, and so on).
- In expressions,
${timeslice}becomes that interval literal. - After
@,${timeslice}becomes timestamp truncation derived from the interval (for example1h→@1h).
Example spec (JSON):
{
"timeslice": {
"kind": "primitive",
"type": "interval"
}
}
With timeslice set to "1h", timestamp @${timeslice} becomes timestamp@1h after substitution.