title: How to add random value in Json Body in Gatling?
body: <p>I need to create a random positive integer each time and send it to Json body in Gatling.</p>
  
  <p>I used the below code to create a random positive ineger:</p>
  
  <pre><code>val  r = new scala.util.Random;
  val OrderRef = r.nextInt(Integer.MAX_VALUE);
  </code></pre>
  
  <p>but, How can I feed the randomly generated value into the json body?</p>
  
  <p>I tried:</p>
  
  <pre><code>.exec(http("OrderCreation")
  .post("/abc/orders")
  .body(StringBody("""{    "orderReference": "${OrderRef}"}""").asJson)  
  </code></pre>
  
  <p>But, this doesn't seem to work. Any clues please.</p>
  
  <p>Thanks!</p>