05 Jun 2026 08:15 AM
I'm building a dashboard with a code tile and I want to use a variable to filter my query. The variable is set on the dashboard, but I cannot find a way to reference it inside the code tile. I tried getting it through context:
export default async function (context) {
console.log(context)
const cluster = context.variables.Cluster;
...
}The console out:
{
"$dt_timeframe_from": "2026-06-05T04:47:00.000Z",
"$dt_timeframe_to": "2026-06-05T06:47:00.000Z"
}So basically my question is that is there any way to reference the Dashboard Variable within the code tile?
05 Jun 2026 02:06 PM
Have you tried reference it "as is"? $yourvarname
I have a var called $Tenant in one of my Dashboards, and in the code tile I just mention the var as is, $Tenant
05 Jun 2026 03:11 PM
Yeah, you should just be able to reference it in the code with the standard $varName syntax.
Featured Posts