title: How to replace a JSON value in Play
body: <p>How do I replace a value in a JSON value in Play?<br>
  Code to illustrate:<br></p>
  
  <pre><code>def newReport() = Action(parse.json) { request =&gt;
      var json = request.body
      if((json \ "customerId").as[Int] == -1){
        // replace customerId after some logic to find the new value
      }
      json.validate[Report](Reports.readsWithoutUser).map {
        case _: Report =&gt;
  </code></pre>