- You need to use __groovy() function in order to evaluate the Groovy code in HTTP Request sampler body
- You need to escape
|
- You need to escape
,
- You need to escape
\
Assuming all above the relevant __groovy()
function syntax would be:
${__groovy(vars.get('TemplateID1').replaceAll('\\\|'\,'\,'),)}

Also be aware that there is a __strReplace() function which can also do what you need, in this case the syntax would be:
${__strReplace(${TemplateID1},\\|,\,,)}
If you don't have this function it can be installed as a part of "
Custom JMeter Functions" bundle using JMeter Plugins Manager
"${TemplateID1.replaceAll("|", ",")}",
– tim_yates