1. Variables Scopes
    1. Global Variables
      1. It is used to access data between collections, requests, scripts, and environments
    2. Collection Variables
      1. It is available throughout the requests in a collection and are independent of environments
    3. Environment Variables
      1. It is used to scope your work to different environments
    4. Data Variables
      1. It comes from external CSV and JSON files to define data sets you can use when running collections
    5. Local Variables
      1. It is temporary variables that are accessed in your request scripts
  2. Priority
    1. 05-Global Variables
    2. 04-Collection Variables
    3. 03-Environment Variables
    4. 02-Data Variables
    5. 01-Local Variables
  3. Get the variable
    1. use method ".get"
      1. Example => pm.globals.set("variable_key", "variable_value"); pm.environment.set("variable_key", "variable_value"); pm.collectionVariables.set("variable_key", "variable_value");
    2. variable scope
      1. Global => pm.globals.get()
      2. Collection=> pm.collectionVariables.get()
      3. Environment => pm.environment.get()
      4. Local => pm.variables.get()
  4. Set the variable
    1. use method ".set"
      1. Example => pm.environment.get("variable_key"); pm.globals.get("variable_key"); pm.variables.get("variable_key"); pm.collectionVariables.get("variable_key");
    2. variable scope
      1. Global => pm.globals.set()
      2. Collection=> pm.collectionVariables.set()
      3. Environment => pm.environment.set()
      4. Local => pm.variables.set()
  5. delete the variable
    1. use method ".unset"
      1. Example => pm.environment.unset("variable_key"); pm.globals.unset("variable_key"); pm.collectionVariables.unset("variable_key");
    2. variable scope
      1. Global => pm.globals.unset()
      2. Collection=> pm.collectionVariables.unset()
      3. Environment => pm.environment.unset()
      4. Local => pm.variables.unset()