Neman as a library help required for passing variables around

Hi There,

Hoping someone can help, I’m relatively new to using Newman as a library with NodeJS.

I have a simple collection in Postman with a single get request. Which I am data driving from a CSV file.

I want to be able to pass some data over to the script to allow me to write some of the results from the response data along with some data that is not in the response to a text file.

I’ve tried setting local and global variables but I can seem to access them from my script.

I need to save the response on every request as it is iterating 100’s of times, I have chosen the on('request) event to capture it.

All the data in response I can access and save to a text file without an issue, it’s the iteration Data or variables I can’t seem to access.

Is this by design, any advice would be greatly appreciated.

Thanks in advance.