- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to set a global variable in Postman?
The global variables can be accessed by all the Environments and is available for every request. To set a global variable follow the below steps −
Step1 − Click on the eye icon beside the No Environment dropdown and then click on the Edit link within the Globals section.
Step2 − MANAGE ENVIRONMENTS pop-up opens up. Here, we have added the variable url and the value as https://www.tutorialspoint.com/index.htm. Click on Save then close the pop-up.
Step3 − Now, select a different Environment and see if the Global variable url is accessible. Here, we have two different Environments - Environment_Test and Mock Server.
Step4 − First select the option Environment_Test and add {{url} in the address bar. On hovering over it, we shall show the letter G(meaning global) and the SCOPE as Global.
To use an Environment variable in a request we have to enclose it with double curly braces {{<Global variable name>}}.
Step5 − Select the option No Environment and add {{url} in the address bar. On hovering over it, we shall see the letter G(meaning global) and the SCOPE as Global.
Thus we find that the Global variables can be accessed from any Environments. In Postman, if we have the same variable name added to the Global and Environment (Local) variable, then the preference is given to the local variable.
- Related Articles
- How to create a Global Variable in Postman?
- How to use Global Variable in Postman Request?
- How to clear the global variables in Postman?
- How to declare a global variable in C++
- How to declare a global variable in PHP?
- How to declare a global variable in Python?
- Global Scope Variables in Postman?
- How to define global variable in a JavaScript function?
- How to use a global variable in a Python function?
- How to create and use Global Variable in swift
- How to get the value of environment variable in Postman?
- How to set a Test in Postman with JavaScript Method?
- How do I declare a global variable in Python class?
- How to set Test and Collection Runner in Postman?
- How to set Tests using Functional Method in Postman?
