# Set collection variable dynamically using newman command line

**URL:** <https://community.postman.com/t/set-collection-variable-dynamically-using-newman-command-line/11208>\
**Category:** Help Hub\
**Tags:** newman-project, tests, variables, collections\
**Created:** [March 5, 2020, 5:48pm UTC](https://community.postman.com/t/set-collection-variable-dynamically-using-newman-command-line/11208 "2020-03-05T17:48:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fhanggi](https://avatars.discourse-cdn.com/v4/letter/f/a87d85/32.png) [@fhanggi](https://community.postman.com/u/fhanggi)\
**Post date:** [March 5, 2020, 5:48pm UTC](https://community.postman.com/t/set-collection-variable-dynamically-using-newman-command-line/11208/1 "2020-03-05T17:48:38Z")

</div>

> **Archived topic — this may be out of date.**  
> Newman has been replaced by the **[Postman CLI](https://learning.postman.com/docs/postman-cli/postman-cli-overview/)**, Postman’s official, signed command-line tool. It runs collections as Newman did, and also lints API specs, runs mocks and monitors, and syncs local files with Postman from your terminal, CI/CD pipeline or coding agent.  
> Working with an AI coding agent? The [Postman plugin](https://github.com/postmanlabs/postman-plugin) lets agents in Claude Code, Cursor, Codex and others design, mock, test and ship APIs with Postman.  
> For current help, see the [Postman docs](https://learning.postman.com/docs/), try the free [Postman tools](https://www.postman.com/tools) (no account needed), or join us on [Discord](https://discord.gg/58aNNsRBGR).

I’m executing newman from an Azure Devops build . Command is as shown below and works.  
As you can see i’m dynamically changing environment variables using --env-var

newman run “$(PostManCollectionFileName)” -e “$(PostManEnvironmentFileName)” -k --insecure --reporters cli,junit --reporter-junit-export Results\junitReport.xml --verbose --disable-unicode --env-var “TestStreetName=$(TestStreetName)” --env-var “webAppUrl=$(webAppUrl)” --env-var “TestStreetNumber=$(TestStreetNumber)”

I would like to change collection variables not just environment variables. The reason for that is that environment variables are too broad. I don’t see a way to do set collection variables in the command line right now. Any ideas or help would be very welcome.  
Thank you.
