I can’t seem to access an environement or global variable from inside the template variable. For example, I have created environment variable “x” with value “5”. If I add the following inside the template var within script tags, it doesn’t work:
If I add the following code above the table, it works fine:
<div class="sectionHeader"></div>
<script>
var y = document.getElementsByClassName('sectionHeader');
y[0].innerHTML="HEADING";
</script>
I then create Global variables in my environment globals pane:
Variable “x” with initial and current value “HEADING”
Variable “y” with initial and current value “document.getElementsByClassName(‘sectionHeader’);”
If I change the content of my script tag to this it does not work:
pm.globals.get(“x”);
pm.globals.get(“y”);
y[0].innerHTML=x;