Postman: Accessing environment Variables

Profile picture for user arilio666

We can access the variables we store in our postman environment and use it for our own.

But how do we use it?

Let's see how we can access the variable in a workspace collection step by step.

Let us first navigate to our collection. If you don't know how the collection is created and what it is, click this link https://www.programsbuzz.com/article/how-create-postman-collection.

  • Click the eye icon once inside the collection.
  • Click on add that's mentioned straight of environment.

  • Now we have named the environment as URL, added variable name as baseURL, and set the value for the variable.

  • Go back to your collections and set URL environment, and to access the set URL variable, use {{baseURL}}.
  • This will access the variable value we just set.

  • We can see that when we hover over the variable name, we can see that it accesses the URL value we set in the URL environment.

  • It also does the GET method and fetches user details from the site with the variable name intact.