Newman - Automatically persist variables

Hi
I want to automaticly update my enviroment variables, then export my environment file and use it in next postman request.

I run request one by one with newman. I group requests in folders, and each folder is my TestScenario. After execution of that test, i log result to my database, and execute next.

What i want to achieve is: Having a jsonfile with url to api, then run special request which will only setVariables in prerequest script, based on this json file. Then i want to export updated env and use in next requests. Unfortunately postman.setEnvironmentVariable and pm.environment.set updated only CurrentValue of variable, so after export value is still the same.

I would like to not do that with some string replace in json file, but do that with postman. How Can i do that?

Collection and environment are local files. They are under git version control. I run collection with newman

Sorry we didn’t get to this sooner. This isn’t the experience we want for our users.

We’re closing out older posts to help keep the community organized and relevant. If this issue is still affecting you, please start a new topic with any updated details and we’ll be happy to help.