How to clear the global variables in Postman?

We can clear the Global variables in Postman at runtime with the help of scripts. This is done with the help of the pm.* function. The script to clear the Global variables can be incorporated either in the Tests or Pre-Request Script tab

To clear the Global variable, the script should be −To clear the Global variable, the script should be −

pm.globals.unset('<name of Global variable>')

Let us try to clear the Global variable url.

Step1 − Add the below script in the Pre-request Script tab −


Step2 − Click on Send to execute a request.

Step3 − After the Response is received, click on the eye icon to the right upper corner of the Postman application. Now, it no longer shows the Global variable url which was previously available.