title: How to access a property of a JSON object stored as environment variable from within the request body?
body: <p>Here I am storing the response object in the environment variable.</p>
  
  <pre><code>   let res = pm.response.json(); 
     postman.setEnvironmentVariable('currentUser', JSON.stringify(res));
  </code></pre>
  
  <p>res object has a property called "userId"</p>
  
  <p>In another request body I want to set the userId to the value stored in the currentUser object. Something like this.</p>
  
  <pre><code>"userId": "{{currentUser.userId}}",
  </code></pre>
  
  <p>But this didn't work.</p>
  
  <p>Converting to JSON also didn't work.</p>
  
  <pre><code>"userId": "{({JSON.parse(currentUser)).userId}}",
  </code></pre>
  
  <p>Is it possible to do this in Postman?</p>
  
  <p>EDIT</p>
  
  <p>There are many properties in the object that are used in different other requests. I was thinking that rather than creating environment variable for each an every one of them, if I could just save the object and pass them when needed. That was the reasoning behind it.</p>