How to get variable from environment in pre-req into the value attribute

Hello everyone,

I am pretty new in both automation tests and postman and would appreciate your advice.

I have such request in Pre-req scripts


  url:  "", 

  method: 'POST',

  header: {

    'Accept': 'application/json',

    'Content-Type': 'application/x-www-form-urlencoded'


  body: {

      mode: 'urlencoded',

      urlencoded: [

        {key: "accessCode1", value: "XXX", disabled: false},

        {key: "accessCode2", value: "XXX", disabled: false},

        {key: "grant_type", value: "password", disabled: false},

        {key: "scope", value: "openid https", disabled: false},



}, function (err, res) {



And my question is how to use (get) variables stored at the environmental level and use them to “value” to be this script correctly sent. I do not want to use visible passwords in these values.

        {key: "accessCode1", **value: "XXX"**, disabled: false},

        {key: "accessCode2", **value: "XXX"**, disabled: false},

Many thanks for your help