title: Postman: set Environment Variable
body: <p>I have a POST call in Postman that returns this JSON object:</p>
  
  <pre><code>{
      "token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiO3Jsb3Blei5hbnRvbmlvODVAZ21haWwuY29tIiwiZXhwIjoxNTkzNjc0MzUxLCJpYXQiOjE1MzMxOTQzNTF9.oTPVkcgF1QcoOsg6KDGOaaTyCQYrWS51QDdRn__MDigivcsuaqUgBhDaTYwQnxOtOCjxDRXO_cqK8i5xBq02bQ"
  }
  </code></pre>
  
  <p>In my environment I set a variable named <code>token</code></p>
  
  <p>I want to set the value. I've tried with</p>
  
  <pre><code>var data = JSON.parse(responseBody);
  postman.setEnvironmentVariable("token", data.message.token);
  </code></pre>
  
  <p>and</p>
  
  <pre><code>var data = pm.response.json();
  pm.environment.set("token", data.message.token);
  </code></pre>
  
  <p>but both with errors: <strong>SyntaxError | Invalid or unexpected token</strong></p>