Skip to main content
Check out the Cheatsheet for a high-level summary of all Omni’s currently-supported tags.

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 and 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:
  1. Enter draft mode in a workbook.
  2. In the tab of the query, open the Results panel.
  3. 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. Using the query results panel to locate the names of a view and field

control_id

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

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.
Syntax
{{fields.view_name.field_name.element}}
Requires the following keys:
fields
required
Accesses query field data
view_name
required
The name of the view that contains the field
field_name
required
The name of the field
element
required
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.
Syntax
{{fields.view_name.field_name.view_label}}

Example

Input
{{fields.customers.id.view_label}}
Example view name

Field name

Returns the dispaly name of the field.
Syntax
{{fields.view_name.field_name.label}}

Example

Input
{{fields.customers.id.label}}
Example field name

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:
Syntax
{{result.data_point.view_name.field_name.value_type}}
The following keys must always be provided, regardless of the data point being retrieved:
result
required
Accesses query result data
data_point
required
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
required
The name of the view that contains the field
field_name
required
The name of the field. Refer to the Locating keys section for help finding this and the view_name.
value_type
required
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 interactivity
  • raw - No formatting or interactivity

First row value

Returns the first value in the result set for the specified field.
Syntax
{{result._first.view_name.field_name.value_type}}
This example uses value_static, which returns a formatted value with no interactivity:

Example

Input
{{result._first.customers.first_name.value_static}}
Example first row value

Last row value

Returns the last value in the result set for the specified field.
Syntax
{{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.

Example

Input
{{result._last.customers.first_name.value}}
Example last row 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.
Syntax
{{result.row_number.view_name.field_name.value_type}}
For example, to return a value from row 11, use 10 as the row_number:

Example

Input
{{result.10.customers.first_name.raw}}
Example specific row value

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.
Syntax
{{result._total.first.view_name.field_name.value_type}}

Example

Input
{{result._total.first.customers.total_price_sum.value}}
Example column total

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.
Syntax
{{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:
Example
{{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.
Syntax
{{result.totals._first.row_total.view_name.field_name.value_type}}
Example
{{result.totals._first.row_total.customers.total_price_sum.value}}

Query and 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.
Syntax
{{inspect}}

Filters

Returns metadata about dashboard filters.
Syntax
{{filters.view_name.field_name.element}}
Requires the following keys:
filters
required
Accesses filter data
view_name
required
The name of the view that contains the field used in the filter
field_name
required
The name of the field used in the filter. Refer to the Locating keys section for help finding this and the view_name.
element
required
The data you want to retrieve, such as label. 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.
Syntax
{{filters.view_name.field_name.label}}

Example

Input
{{filters.customers.country.label}}
Example filter 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.
Syntax
{{filters.view_name.field_name.summary}}

Example

Input
{{filters.customers.country.summary}}
Example filter summary

Value

Returns the current value of the filter.
Syntax
{{filters.view_name.field_name.value}}
Example
{{filters.customers.country.value}}

Controls

Returns metadata about dashboard controls.
Syntax
{{controls.control_id.element}}
Requires the following keys:
controls
required
Accesses control data
control_id
required
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
required
The data you want to retrieve, such as label. 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.
Syntax
{{controls.id.label}}

Example

Input
{{controls.8v_G12D7.label}}
Example control 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.
Syntax
{{controls.id.summary}}

Example

Input
{{controls.8v_G12D7.summary}}
Example control summary (default value)

Value

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

Example

Input
{{controls.8v_G12D7.value}}
Example control value

JSON

Returns the URL-encoded JSON of the control.
Syntax
{{controls.id.json}}
Example
{{controls.8v_G12D7.json}}
Example output
%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
required
Accesses Omni metadata
userAttributes
required
Accesses Omni user attribute data
attribute_reference
required
The reference of the attribute you want to retrieve data for, for example omni_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
required
The data you want to retrieve. Can be either of the following:
  • label - The display name of the attribute, for example Omni 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.
Syntax
{{metadata.userAttributes.omni_user_email.values}}

User name

Returns the user name (omni_user_name value) of the user currently viewing the dashboard.
Syntax
{{metadata.userAttributes.omni_user_name.values}}

User ID

Returns the user ID (omni_user_id value) of the user currently viewing the dashboard.
Syntax
{{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.
Syntax
{{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.
Syntax
{{metadata.userAttributes.custom_attribute_reference.values}}
Example
{{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.
Syntax
{{metadata.userAttributes.omni_user_groups.values}}