Closed tichribra closed 1 year ago
I am facing the same issue. I am trying to create a JSON object and then trying to pass dashboard variables in JS Code section but when I view the JSON in Console, it doesn't replace it with dashboard variable (console screenshot attached below)
Solution: Wrap it inside built-in function repaceVariables("${var_name}")
Example:
@akshay996 thanks for that idea but when I use it I get repaceVariables is not defined
any idea?
ok got it !
const bonjour = replaceVariables("${composant}");
console.log(bonjour.toUpperCase())
replaceVariables
is mentioned in the documentation (https://volkovlabs.io/plugins/volkovlabs-dynamictext-panel/code/), but we don't provide any examples of using it.
I will update the documentation to make it clear.
Updated in the documentation: https://volkovlabs.io/plugins/volkovlabs-dynamictext-panel/code/
Hello,
I would like to know if it is possible to use grafana dashboard variables inside the JavaScript code section. I tried it with the common way "$variableName" like in the data manipulation plugin but it doesn't work.