<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Dashboard Variables in Code Tile in Dashboarding</title>
    <link>https://community.dynatrace.com/t5/Dashboarding/Dashboard-Variables-in-Code-Tile/m-p/300383#M5813</link>
    <description>&lt;P&gt;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:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;export default async function (context) {
  console.log(context)
  const cluster = context.variables.Cluster;
  ...
}&lt;/LI-CODE&gt;&lt;P&gt;The console out:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "$dt_timeframe_from": "2026-06-05T04:47:00.000Z",
  "$dt_timeframe_to": "2026-06-05T06:47:00.000Z"
}&lt;/LI-CODE&gt;&lt;P&gt;So basically my question is that is there any way to reference the Dashboard Variable within the code tile?&lt;/P&gt;</description>
    <pubDate>Fri, 05 Jun 2026 07:15:36 GMT</pubDate>
    <dc:creator>Mikko</dc:creator>
    <dc:date>2026-06-05T07:15:36Z</dc:date>
    <item>
      <title>Dashboard Variables in Code Tile</title>
      <link>https://community.dynatrace.com/t5/Dashboarding/Dashboard-Variables-in-Code-Tile/m-p/300383#M5813</link>
      <description>&lt;P&gt;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:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;export default async function (context) {
  console.log(context)
  const cluster = context.variables.Cluster;
  ...
}&lt;/LI-CODE&gt;&lt;P&gt;The console out:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "$dt_timeframe_from": "2026-06-05T04:47:00.000Z",
  "$dt_timeframe_to": "2026-06-05T06:47:00.000Z"
}&lt;/LI-CODE&gt;&lt;P&gt;So basically my question is that is there any way to reference the Dashboard Variable within the code tile?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2026 07:15:36 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dashboarding/Dashboard-Variables-in-Code-Tile/m-p/300383#M5813</guid>
      <dc:creator>Mikko</dc:creator>
      <dc:date>2026-06-05T07:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard Variables in Code Tile</title>
      <link>https://community.dynatrace.com/t5/Dashboarding/Dashboard-Variables-in-Code-Tile/m-p/300395#M5814</link>
      <description>&lt;P&gt;Have you tried reference it "as is"? $yourvarname&lt;/P&gt;&lt;P&gt;I have a var called $Tenant in one of my Dashboards, and in the code tile I just mention the var as is, $Tenant&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2026-06-05 100551.png" style="width: 476px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/33375i8C63C55681928229/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2026-06-05 100551.png" alt="Screenshot 2026-06-05 100551.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2026 13:06:57 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dashboarding/Dashboard-Variables-in-Code-Tile/m-p/300395#M5814</guid>
      <dc:creator>dannemca</dc:creator>
      <dc:date>2026-06-05T13:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard Variables in Code Tile</title>
      <link>https://community.dynatrace.com/t5/Dashboarding/Dashboard-Variables-in-Code-Tile/m-p/300397#M5815</link>
      <description>&lt;P&gt;Yeah, you should just be able to reference it in the code with the standard $varName syntax.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AndyHubert_0-1780668686484.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/33376iFD304058057CECEA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AndyHubert_0-1780668686484.png" alt="AndyHubert_0-1780668686484.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2026 14:11:51 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dashboarding/Dashboard-Variables-in-Code-Tile/m-p/300397#M5815</guid>
      <dc:creator>AndyHubert</dc:creator>
      <dc:date>2026-06-05T14:11:51Z</dc:date>
    </item>
  </channel>
</rss>

