title: Postman: how to evaluate json arrays
body: <p>With Postman it is possible to save a special field from the response body into a variable and use the value of this variable in a consecutive call.</p>
  
  <p>For example:
  in my first call to the webservice the following is returned in the response body</p>
  
  <pre><code>[ {
    "id" : "11111111-1111-1111-1111-111111111111",
    "username" : "user-1@example.com",
  }, {
    "id" : "22222222-2222-2222-2222-222222222222",
    "username" : "user-2@example.com"
  } ]
  </code></pre>
  
  <p>I have added a test</p>
  
  <pre><code>postman.setGlobalVariable("user_0_id", JSON.parse(responseBody)[0].id);
  </code></pre>
  
  <p>Now I send a consecutive request to the webservice with the URL</p>
  
  <pre><code>http://example.com/users/{{user_0_id}}
  </code></pre>
  
  <p>Postman evaluates <code>{{user_0_id}}</code> to <code>11111111-1111-1111-1111-111111111111</code>.</p>
  
  <p>This works fine. But now I add to the test of my first call</p>
  
  <pre><code>postman.setGlobalVariable("users", JSON.parse(responseBody));
  </code></pre>
  
  <p>In my second request to the webservice I call the URL</p>
  
  <pre><code>http://example.com/users/{{users[0].id}}
  </code></pre>
  
  <p>But now <code>{{users[0].id}}</code> cannot be evaluated, it stays the same and is not replaced by <code>11111111-1111-1111-1111-111111111111</code>.</p>
  
  <p>What can I do? What is the correct syntax of the call?</p>