by replacing '1234' with myVar. Yes, it's that simple ;)
you need to create the variable first. Just put it into the renderargs, use #{set /} (carefully, can cause sideeffects) or use a groovy code block: %{ ....... }%
The renderargs should be the best solution.