@{constant_name} syntax.
Constants are resolved before other template processing (Mustache and field references) when a query executes or a link renders, making them ideal for values that need to be centrally managed and consistently applied across your model. For example:
- Database schema names that may differ between environments
- Common URL patterns for data links
- Repeated string values that you want to maintain in a single location
- Configuration values that can be dynamically referenced
Syntax
Properties
A map of constant definitions where each key is the constant name. Names must be unique within the model.
Examples
Dynamic schema reference
Use constants to reference schema names that may vary across environments. Define the constants in the model file:Model file
View file
Dynamic links with field references
Create link patterns that include field references. Define the constants in the model file:Model file
Dimensions in a view