Skip to main content


Use the replaceVariables() function to replace dashboard and global variables.

const email = replaceVariables("${}");

You can get familiar with three types of variables in our Grafana Crash Course.

Replace Variables

In the following example, we replaced the series's name with a value from the variable.

Replace Dashboard Variables.
Replace Dashboard Variables.



Update Variables

You can update dashboard variables with event handlers, where

  • name is the name of the variable. Add var- to update the variable value in the URL.
  • value is the updated value.
echartsInstance.on("click", (params) => {
locationService.partial({ "var-name": value }, true);