Mustache syntax reference
The Mustache tags in this reference can be used to create dynamic content in your visualizations and dashboards.
Check out the Cheatsheet for a high-level summary of all Omni's currently-supported tags.
Syntax
In Mustache, a tag is indicated by double mustaches, for example {{results}}
. A tag is made up of one or more keys, which are used to find the requested data. In the previous example, results
is the key in {{results}}
.
Locating keys
Several Omni tags require specific keys, such as a view_name
or a field_name
. Refer to the following sections for help finding this information in Omni.
view_name & field_name
The view_name
and field_name
keys are used in Query field and Query result tags.
To locate the name of a view or field in a query:
- Enter draft mode in a workbook.
- In the tab of the query, open the Results panel.
- In the Fields section, locate a field and click the (caret icon).
Below the Label field will be the name of the view and the field. In the example image (click to enlarge), this is main__customers.id
. main__customers
is the view_name
, and id
is the field_name
.

control_id
The control_id
key is used in Control tags.
To locate the ID of a dashboard control:
- Enter draft mode in a dashboard.
- Locate the control at the top of the dashboard and click the (pencil icon) to open the Edit control panel.
- Locate the ID field at the bottom of the panel. In the example image, the ID is
8v_G12D7
.

Query fields
Query field tags are only supported in visualizations, meaning they can't be used in Markdown dashboard tiles.
Returns metadata about a specific query field.
{{fields.view_name.field_name.element}}
Requires the following keys:
fields
- Accesses query field dataview_name
- The name of the view that contains the fieldfield_name
- The name of the fieldelement
- The data you want to retrieve, such as the display name of the field. Refer to the following sections for information on what is currently supported.
View name
Returns the display name of the view that contains the specified field.
{{fields.view_name.field_name.view_label}}
{{fields.customers.id.view_label}}

Field name
Returns the dispaly name of the field.
{{fields.view_name.field_name.label}}
{{fields.customers.id.label}}

Query results
Query result tags are only supported in visualizations, meaning they can't be used in Markdown dashboard tiles.
Returns a result value from a query. The syntax varies depending on the data point you want to retrieve, but typically looks like the following:
{{result.data_point.view_name.field_name.value_type}}
The following keys must always be provided, regardless of the data point being retrieved:
result
- Accesses query result datadata_point
- The type of data point you want to retrieve, such as the value of a field in the first row of query results (_first
). Refer to the following sections for information on what's currently supported.view_name
- The name of the view that contains the fieldfield_name
- The name of the field. Refer to the Locating keys section for help finding this and theview_name
.value_type
- Determines the level of interactivity and formatting of the returned value:value
- Interactive; user can click to copy, drill, etc.value_static
- Formatting applied, no interactivityraw
- No formatting or interactivity
First row value
Returns the first value in the result set for the specified field.
{{result._first.view_name.field_name.value_type}}
This example uses value_static
, which returns a formatted value with no interactivity:
{{result._first.customers.first_name.value_static}}

Last row value
Returns the last value in the result set for the specified field.
{{result._last.view_name.field_name.value_type}}
This example uses value
, which allows dashboard users to click and interact with the value. Note the dropdown menu over the value in the example image.
{{result._last.customers.first_name.value}}

Specific row value
Returns a field value from the specified row (row_number
) in the result set.
In Omni, row numbering begins at 0. When you define the variable, subtract one from the number of the actual row you want to reference.
{{result.row_number.view_name.field_name.value_type}}
For example, to return a value from row 11
, use 10
as the row_number
:
{{result.10.customers.first_name.raw}}

Column total
Returns the total of a specified column in the result set. Requires Column totals to be enabled in the query's Results options panel.
{{result._total.first.view_name.field_name.value_type}}
{{result._total.first.customers.total_price_sum.value}}

Row total
Returns the total of a specified row (row_number
) in a pivoted result set. Requires a query with at least one pivot and for Row totals to be enabled in the query's Results options panel.
In Omni, row numbering begins at 0. When you define the variable, subtract one from the number of the actual row you want to reference.
{{result.row_number.row_total.view_name.field_name.value_type}}
For example, to return values from row 6
, use 5
as the row_number
:
{{result.5.row_total.order_items.sale_price_sum.value}}
Grand total
Returns the grand total of a specified column in a pivoted result set. Requires a query with at least one pivot and for Column totals to be enabled in the query's Results options panel.
{{result.totals._first.row_total.view_name.field_name.value_type}}
{{result.totals._first.row_total.customers.total_price_sum.value}}
Query & user attribute inspection
Query & user attribute inspection is only supported in Markdown visualizations.
Returns the elements of a query and user attribute metadata in JSON format.
{{inspect}}


Filters
Returns metadata about dashboard filters.
{{filters.view_name.field_name.element}}
Requires the following keys:
filters
- Accesses filter dataview_name
- The name of the view that contains the field used in the filterfield_name
- The name of the field used in the filter. Refer to the Locating keys section for help finding this and theview_name
.element
- The data you want to retrieve, such aslabel
. Refer to the following section for information on what's currently supported.
Label
Returns the label of the filter. In a dashboard, open the Edit panel for the filter and locate the Label field.
{{filters.view_name.field_name.label}}
{{filters.customers.country.label}}

Summary
Returns the default value (summary) of the filter. In a dashboard, open the Edit panel for the filter and locate the Default value field.
{{filters.view_name.field_name.summary}}
{{filters.customers.country.summary}}

Value
Returns the current value of the filter.
{{filters.view_name.field_name.value}}
{{filters.customers.country.value}}
Controls
Returns metadata about dashboard controls.
{{controls.control_id.element}}
Requires the following keys:
controls
- Accesses control datacontrol_id
- The ID of the control, located in the Edit control panel. Refer to the Locating keys section if you need help finding this panel.element
- The data you want to retrieve, such aslabel
. Refer to the following section for information on what's currently supported.
Label
Returns the label of the control. In a dashboard, open the Edit panel for the control and locate the Label field.
{{controls.id.label}}
{{controls.8v_G12D7.label}}

Summary
Returns the default value (summary) of the control. In a dashboard, open the Edit panel for the control and locate the Default value field.
{{controls.id.summary}}
{{controls.8v_G12D7.summary}}

Value
Returns the full database name (view_name.field_name
) of the field currently selected in the control.
{{controls.id.value}}
{{controls.8v_G12D7.value}}

JSON
Returns the URL-encoded JSON of the control.
{{controls.id.json}}
{{controls.8v_G12D7.json}}
%7B%22id%22%3A%228v_G12D7%22%2C%22kind%22%3A%22FIELD%22%2C%22type%22%3A%22FIELD_SELECTION%22%2C%22field%22%3A%22customers.birthday%5Bdate%5D%22%2C%22label%22%3A%22Control%20(Switcher)%22%2C%22options%22%3A%5B%7B%22label%22%3A%22Birthday%20Date%22%2C%22value%22%3A%22maincustomers.birthday%5Bdate%5D%22%2C%22isDimension%22%3Atrue%7D%2C%7B%22label%22%3A%22Created%20Date%20Date%22%2C%22value%22%3A%22main__customers.created_date%5Bdate%5D%22%2C%22isDimension%22%3Atrue%7D%5D%7D
User attribute metadata
Returns information about the user attributes associated with the user currently viewing the dashboard.
{{metadata.userAttributes.attribute_reference.element}}
Requires the following keys:
metadata
- Accesses Omni metadatauserAttributes
- Accesses Omni user attribute dataattribute_reference
- The reference of the attribute you want to retrieve data for, for exampleomni_user_email
. The following sections demonstrate some of the Omni system attributes you can use in tags. Refer to the Reference column in Settings > User attributes to locate an attribute's reference.element
- The data you want to retrieve. Can be either of the following:label
- The display name of the attribute, for exampleOmni user email
values
- The attribute value set for the user
User email
Returns the email address (omni_user_email
value) of the user currently viewing the dashboard.
{{metadata.userAttributes.omni_user_email.values}}
User name
Returns the user name (omni_user_name
value) of the user currently viewing the dashboard.
{{metadata.userAttributes.omni_user_name.values}}
User ID
Returns the user ID (omni_user_id
value) of the user currently viewing the dashboard.
{{metadata.userAttributes.omni_user_id.values}}
Is org admin?
Returns true
if the user currently viewing the dashboard is an Organization Admin (omni_is_org_admin
value). Otherwise, returns false
.
{{metadata.userAttributes.omni_is_org_admin.values}}
Custom user attribute
Returns the value of a custom user attribute of the user currently viewing the dashboard, where custom_attribute_reference
is the reference of the custom attribute.
{{metadata.userAttributes.custom_attribute_reference.values}}
{{metadata.userAttributes.blob_entity.values}}
User groups
Returns a list of user groups (omni_user_groups
value) that the user currently viewing the dashboard is a member of.
If the user is a member of more than one group, the output will be a comma-delimited list like Group 1, Group 1
.
{{metadata.userAttributes.omni_user_groups.values}}
Cheatsheet
Omni key locations How to find key values used in various Omni tags. Refer to the Locating keys section for detailed information. | ||
view_name | Required for Query field tags and Query result tags. In the Results options panel of a workbook query tab, open the options menu for a field. The text below the Label field contains the view_name . Refer to the Locating keys section for more information. | |
field_name | Required for Query field tags and Query result tags. In the Results options panel of a workbook query tab, open the options menu for a field. The text below the Label field contains the field_name . Refer to the Locating keys section for more information. | |
control_id | Required for Control tags. In a draft dashboard, click the (pencil icon) on a control and locate the ID field in the panel. Refer to the Locating keys section for more information. | |
attribute_reference | Required for User attribute tags. Located in the Reference column of Settings > User attributes. | |
Query fields Returns metadata about a specific query field. Supported in Markdown visualizations. | ||
View name | {{fields.view_name.field_name.view_label}} | |
Field name | {{fields.view_name.field_name.label}} | |
Query results Returns a result value from query results. Returned values can be interactive or static. Supported in Markdown visualizations. | ||
Query result value types Specifies the formatting and interactivity of the returned value. | ||
Interactive value | Specified with value , ex: {{result._first.view_name.field_name.value}} | |
Formatted value | Specified with value_static , ex: {{result._first.view_name.field_name.value_static}} | |
Raw value | Specified with raw , ex: {{result._first.view_name.field_name.raw}} | |
Query result data points Data points that can be retrieved from results of a query. | ||
First row value | {{result._first.view_name.field_name.value_type}} | |
Last row value | {{result._last.view_name.field_name.value_type}} | |
Specific row value | {{result.row_number.view_name.field_name.value_type}} | |
Column total | {{result._total.first.view_name.field_name.value_type}} | |
Row total (pivot) | {{result.row_number.row_total.view_name.field_name.value_type}} | |
Grand total | {{result.totals._first.row_total.view_name.field_name.value_type}} | |
Query & user attribute inspection Returns the elements of a query and user attribute metadata in JSON format. Supported in Markdown visualizations. | ||
Inspect | {{inspect}} | |
Filters Returns metadata about dashboard filters. Supported in dashboard Markdown tiles. | ||
Label | {{filters.view_name.field_name.label}} | |
Summary | {{filters.view_name.field_name.summary}} | |
Value | {{filters.view_name.field_name.value}} | |
Controls Returns metadata about dashboard controls. Supported in dashboard Markdown tiles. | ||
Label | {{controls.control_id.label}} | |
Summary | {{controls.control_id.summary}} | |
Value | {{controls.control_id.value}} | |
JSON | {{controls.control_id.json}} | |
User attributes Returns information about the user attributes associated with the user currently viewing the dashboard. Supported in dashboard Markdown tiles. | ||
Elements Specifies the value returned from the user attribute. | ||
Label / display name | Specified with label , ex: {{metadata.userAttributes.attribute_reference.label}} | |
Value(s) | Specified with values , ex: {{metadata.userAttributes.attribute_reference.values}} | |
Attributes Returns the display name or value of the specified user attribute. | ||
User email | {{metadata.userAttributes.omni_user_email.element}} | |
User name | {{metadata.userAttributes.omni_user_name.element}} | |
User ID | {{metadata.userAttributes.omni_user_id.element}} | |
Is org admin? | {{metadata.userAttributes.omni_is_org_admin.element}} | |
Custom user attribute | {{metadata.userAttributes.custom_attribute_reference.element}} | |
User groups | {{metadata.userAttributes.omni_user_groups.element}} |