How to delete tens of thousands of global variables?

when I use bulk edit to add globals, I accidently paste my clipboard(about 30 thousands lines) to the edit box, and postman create about 30 thousands global variable for me.
now I cant open the edit box to delete all the variable cause the UI just froze or get all black.
How I can delete all the variable? Help me please

1 Like

@layasa Could you restart the app and send a request that has the following test script code?

pm.globals.clear(); // This will remove all globals, use with caution.

It works! Thank you, you saved my life !:grinning:

1 Like

Where do you paste? In the request? Can you remove environments too?

@snee For an environment, you can do the same and you can put it in any of the test scripts

  1. Select an environment from the drop-down.

  2. Paste the following in any of your test script to clear the variables of that active environment.

// This will remove all variables in an environment, use with caution.
1 Like

It does not work for me.

What are all the criteria that need to be in place for this to work?

@snee Probably something else you might be doing wrong.

Was this expected after running the command?
That no environments must be left, all must be cleared off the list?

Did you get an error while running the request with the above mentioned command?

The plan is to wipe all environments and replace with all new ones.

That’s exactly what I wrote that the pm.environment.clear() will only clear the VARIABLES that belong to AN ENVIRONMENT.

There’s no way you’ll be able to delete all the environments.

The only way to do that would be:

  1. Click on ‘Manage Environments’
  2. Delete each environment manually through the dropdown