1-Use pm.globals to define a global variable:
2
3pm.globals.set("variable_key", "variable_value");
4
5-Use pm.collectionVariables to
6define a collection variable:
7
8pm.collectionVariables.set("variable_key", "variable_value");
9
10-Use pm.environment to define an environment
11variable (in the currently selected environment):
12
13pm.environment.set("variable_key", "variable_value");
14
15-You can use unset to remove a variable:
16pm.environment.unset("variable_key");
17
18-Defining local variables
19Local variables are temporary values you set
20in your request scripts using the following syntax:
21
22pm.variables.set("variable_key", "variable_value");