Controlling variable scope to request level

Hello @morleym_cubic, welcome to the community! :wave:

There are two things that can help you out.

  1. Sessions

You can make your team-members TURN OFF the “Automatically Persist Variables” in the Settings and then it will no longer pollute the environment until a team member actually decides to persist the values.

  1. Local Variables in a request

Instead of using the environment variables, you can use local variables.
These variables are only available during the execution of the request and aren’t persisted anywhere.

For eg:

// Pre-request script
const randomlyGeneratedEmail = () => return 'someRandomEmail';
const email = randomlyGeneratedEmail();
pm.variables.set('email', email);

Now, you can use this variable in your request anywhere as you would use a variable with curly braces.

For eg.:

https://postman-echo.com/get?foo={{email}}

And it’ll be resolved during execution and will not be persisted anywhere.