Use the Dashboard variable in a code block

I would like to use a dashboard variable in a code block, but I can’t seem find any documentation on how to do this. Is there even a way to do this?

Found the solution, you just have to use the $-notation.

Hello
Yes it is possible the same way you use it in DQL. The exact syntax could depend on the type of variable and where it is used in the code. Here’s a simple example taken from the Dynatrace Tenant Review dashboard: