I’m using newman as a node module and I’m trying to either set a global/environment variable as a js variable or access & parse the response and set it as a variable that way - I can’t find anything in the reference material that explains how to do this. I did find exportGlobals: require(‘xxx.json’); - but this doesn’t seem to actually update the specified json file at all (the variable in question has no value set).
My actual use case is:
I get sent a collection name as part of a request to my node server, I send the collection name to the ‘Single Collection’ postman API: https://www.getpostman.com/collections/8a54de8f97aab0f5722c
This returns the UID which I then use to run the collection in question. The variable I’m trying to set is the UID - either by setting it as a global/environment variable then exporting and parsing the file, or by directly parsing the response.
Does anyone know a way to do this?