title: Error in evaluating the test script when retrieving a string from the response in postman
body: <p>From the below response structure i want to retrieve the id field and save it in the environment variable in postman.</p>
  
  <p>I tried all possible methods to do it but unable to do so.</p>
  
  <pre><code>{
      "childMaxAge": 13,
      "selectedForBooking": [
          {
              "id": "0661be61-d0ae-411009-a96d-64229a",
              "firstName": "Test",
              "gender": {
                  "code": "MALE",
                  "name": "Male"
              }
     ]
  }
  </code></pre>
  
  <p>i have tried the below and it also doesn't work.</p>
  
  <pre><code>tests["Status code is 201"] = responseCode.code === 201;
  var data = JSON.parse(responseBody);
  console.log(data);
  var custid=JSON.parse(data.selectedForBooking[0].id);
  tests ["selectedForBooking"]= postman.setEnvironmentVariable("CustId1", custid);
  </code></pre>
  
  <p>but it gives error :</p>
  
  <p>There was an error in evaluating the test script:  JSONError: Unexpected token '6' at 1:2 0661be61-d0ae-411009-a96d-64229a ^</p>