Can we use pm.environment.set() and after that refers the value when run the collection using newman?

Archived topic — this may be out of date.
Newman has been replaced by the Postman CLI, 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 lets agents in Claude Code, Cursor, Codex and others design, mock, test and ship APIs with Postman.
For current help, see the Postman docs, try the free Postman tools (no account needed), or join us on Discord.

can we use pm.environment.set() and after that use the value when run the collection using newman?

I have case to collect access token response value from login request, then save the value to the environment variable, after that use it for authorization in the next request (run in newman), is it possible?

Hey @hariyaditeguh99 - welcome to the community!

I’m moving this post to Help for tidiness and visibility.

Does this post answer your question?