Setting/getting collection variable value in script

@CBoland First of all, welcome to the community, thanks for coming to ask a good question like this.
When it comes to Collection Variables they are treated a bit differently than Environment and Global variable.
https://learning.getpostman.com/docs/postman/environments_and_globals/variables#defining-collection-variables

Hopefully this will help you out a bit. If the variable is not static, and I assume thats the case if its a token. You will likely need to scope this as an environment variable, you can also unset it at the end of the tests if need be.

Hopefully this helps.

1 Like