Context variables

Context variables are the variables that are associated with a dashboard pages or cards. You can use context variables to create dynamic and customized dashboards and cards. You can change the content of the dashboard page or cards based on the context variables.

A context variable is a dynamic value, which means that if the context variable is changed, the content that is displayed on the page or a card also changes. For example, a product details page requires the context of the product ID. The same detail page can be used for product ProductA and for product ProductB. So, when the context changes from Product A to Product B, the page content changes.

If the cards on a dashboard do not render data, then investigate to find the issue. For more information, see Missing context.

The context variables are categorized into two types:
Page context variables
Dynamic values or parameters that a page needs to be able to load its content successfully. Currently, passing context to a page is done by configuring a link that takes you to that page. When you configure this link, the context is passed by using URL parameters. For more information about adding page context variables, see Configuring page context variables.
Card context variables
Values or parameters that a card needs to be able to load its content successfully. Context variable can be used anywhere in the card. For example, these variables can be used in rendering queries, loading icons, or as label string. These variables can be configured at a page level. You have three options to configure card contexts:
  • Default value (A value that was added as card context at widget level),
  • Static value (User defined value),
  • Page context (The page context variable defined for the page).
For more information about adding card context variables, see Configuring card context variables.

We can configure a card context variable at a page level by clicking on View properties, you will see an accordion in the side navigation that lists all card context variables linked to the selected card. After you click Configure, a Configure card context dialogue opens. Each card context variable is shown as an accordion item with its type highlighted in tags.