# Newman Modifying --env-var Parameter

**URL:** <https://community.postman.com/t/newman-modifying-env-var-parameter/13685>\
**Category:** Help Hub\
**Tags:** newman-project, tests, variables\
**Created:** [June 25, 2020, 11:24pm UTC](https://community.postman.com/t/newman-modifying-env-var-parameter/13685 "2020-06-25T23:24:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jadams](https://avatars.discourse-cdn.com/v4/letter/j/e480ec/32.png) [@jadams](https://community.postman.com/u/jadams)\
**Post date:** [June 25, 2020, 11:24pm UTC](https://community.postman.com/t/newman-modifying-env-var-parameter/13685/1 "2020-06-25T23:24:08Z")

</div>

I’m using Newman to run integration tests via Teamcity and a python script.

I’m using newman cli and --env-var parameters to pass in variables that I can’t store in github. Newman sends a request to my API with a different variable value than I passed in via env-var. I am assuming this has to do with the ‘$’ char. Everything between ‘$’ and ‘#’ is removed from the string. I’m at a loss as to how to correct it.

```
--env-var “password=12$123456?#12345”

Gets turned into: 12?#12345

```

The python script runs a newman cli command similar to this:

> newman run integrationTests/API-Collection.postman\_collection.json -e integrationTests/variables/devIntegration.postman\_environment.json --delay-request 1000 -r teamcity,cli --env-var “username=someusername” --env-var “password=12$123456?#12345” --verbose --bail

Note the change in password below in the request sent by newman:

```
{
  "id": "f2b73f50-f136-47c8-aa13-fc65b7123456",
  "name": "Get MyAPI",
  "headers": {
      "accept": "application/json",
      "authorization": "Basic cantpastethishere",
      "user-agent": "PostmanRuntime/7.26.0",
      "cache-control": "no-cache",
      "host": "myhost.host.com",
      "accept-encoding": "gzip, deflate, br",
      "connection": "keep-alive",
      "content-type": "application/x-www-form-urlencoded",
      "content-length": 108
  },
  "method": "POST",
  "url": "https://myhost.host.com/my/route",
  "data": {
      "username": "someusername",
      "password": "12?#12345",
  }
}

```

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [June 26, 2020, 7:00am UTC](https://community.postman.com/t/newman-modifying-env-var-parameter/13685/2 "2020-06-26T07:00:00Z")

</div>

Hey @jadams

From the command line, `$` would allow you to use a system-level environment variable so it looks like it’s interpreting that value here.

What you _could_ do is store that value as a system-level environment variable like this:

```
export PASSWORD='12$123456?#12345' 

```

Then use that with your Newman run command like this:

```
--env-var "password=$PASSWORD"

```

This will use that value in the Collection run.

 ![Screenshot 2020-06-26 at 07.57.17](https://us1.discourse-cdn.com/getpostman/original/3X/a/4/a45df005a123d38b925be2d1078a54a720bff3f8.png)

I’m using the [htmlextra reporter](https://github.com/DannyDainton/newman-reporter-htmlextra) with the `--reporter-htmlextra-showEnvironmentData` flag to display what variable was used.

---

<div class="post-metadata">

**Author:** ![jadams](https://avatars.discourse-cdn.com/v4/letter/j/e480ec/32.png) [@jadams](https://community.postman.com/u/jadams)\
**Post date:** [July 2, 2020, 7:16pm UTC](https://community.postman.com/t/newman-modifying-env-var-parameter/13685/3 "2020-07-02T19:16:06Z")

</div>

Thanks Danny, that got me going. Good catch and good eyes!
