0

I have a set of JSON templates in a CSV file and a DataInsert: {"Data":"${DataInsert}"}, testdatainsert Variables are defined as JSONTemplate,DataInsert

I'm running an HTTP request with the body: ${__V(JSONTemplate${DataInsert})}

And I would like this to send: {"Data":"testdatainsert"}

However, what I end up sending is JSONTemplatetestdatainsert

I dont think I understood this documentation very well: https://jmeter.apache.org/usermanual/functions.html#what_can_do

Any help would be appreciated.

1 Answer 1

1

If you have a value from CSV which holds another JMeter Function or Variable - you need to wrap it into __eval() function in order to resolve the underlying variable (or function).

If you have:

  • DataInsert variable with the value of testdatainsert
  • JSONTemplate variable with the value of {"Data":"${DataInsert}"}

and you need to get {"Data":"testdatainsert"} - you need to refer the variable as:

${__eval(${JSONTemplate})}

Demo:

enter image description here

More information: Here’s What to Do to Combine Multiple JMeter Variables

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.