# Possible to modify postman variables in newman-nodejs script

**URL:** <https://community.postman.com/t/possible-to-modify-postman-variables-in-newman-nodejs-script/8773>\
**Category:** Help Hub\
**Created:** [November 4, 2019, 3:52pm UTC](https://community.postman.com/t/possible-to-modify-postman-variables-in-newman-nodejs-script/8773 "2019-11-04T15:52:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdang](https://avatars.discourse-cdn.com/v4/letter/j/a88e4f/32.png) [@jdang](https://community.postman.com/u/jdang)\
**Post date:** [November 4, 2019, 3:52pm UTC](https://community.postman.com/t/possible-to-modify-postman-variables-in-newman-nodejs-script/8773/1 "2019-11-04T15:52:00Z")

</div>

Hi Everyone,

I create a few variables in Postman and reference them in the test collection and everything works fine.

Now, I need to run those collections in nodejs and newman and not quite sure how to use Postman environmental variables or overwrite the value of those variables in my script?

thanks,

Jdang

---

<div class="post-metadata">

**Author:** ![jdang](https://avatars.discourse-cdn.com/v4/letter/j/a88e4f/32.png) [@jdang](https://community.postman.com/u/jdang)\
**Post date:** [November 4, 2019, 4:12pm UTC](https://community.postman.com/t/possible-to-modify-postman-variables-in-newman-nodejs-script/8773/2 "2019-11-04T16:12:09Z")

</div>

I think I found the answer.

Thanks,

Jdang

---

<div class="post-metadata">

**Author:** ![allen888](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@allen888](https://community.postman.com/u/allen888)\
**Post date:** [November 5, 2019, 1:15pm UTC](https://community.postman.com/t/possible-to-modify-postman-variables-in-newman-nodejs-script/8773/3 "2019-11-05T13:15:21Z")

</div>

use the “-e” switch in your command line arguments followed by the path to the envionemnt definition. If there are “spaces” in the path or file name enclose the path file name in “quotes”

E.g. -e “C:\Users\username\Documents\Postman Pro\2- Environment Definitions\APITest Environment Definition.postman\_environment.json”

The entire command line string might look like this:  
newman run “C:\Users\username\Documents\Postman Pro\1- Combined Collections\13-MO\_Internal \_API\_Objects.postman\_collection.json” -e “C:\Users\username\Documents\Postman Pro\2- Environment Definitions\APITest Environment Definition.postman\_environment.json”
