documentation/features/variables.mdx
Hoppscotch provides you the ability to create and use variable throughout the app. This helps you reuse values throughout Hoppscotch just by invoking the variable name.
Hoppscotch considers an objects within an angular brackets as a variable <<variable>>
Hoppscotch provides you different variables scopes, allowing you to use different scopes for different contexts.
$ symbol, such as $guid or $timestamp.The scope of each variable can be identified from the color of the variable name. If a variable with same name exist it is resolved in the order of priority.
| Variable Scope | Color | Priority |
|---|---|---|
| Request | 🟠 | 1 |
| Collection | 🟣 | 2 |
| Predefined | 🟡 | 3 |
| Environment | 🟢 | 4 |
| Global | 🔵 | 5 |
| Non resolvable | 🔴 | - |
$ symbol. Below is the list of predefined variables whose values are dynamically generated during the request or collection run:<CardGroup cols={1}> <Card title="Environments" iconType="light" icon="circle-arrow-right" href="/documentation/features/environments" > Choose the environment that aligns best with your development workflow. </Card> </CardGroup>
Variable Name Description Example $guidA v4 style unique (GUID) identifier for each request. 123e4567-e89b-12d3-a456-426614174000$timestampThe current UNIX timestamp in seconds 1693047645$isoTimestampThe current date and time in ISO-8601 format at zero UTC (also known as "Zulu time" or UTC-0) 2024-09-25T00:00:00.000Z$randomUUIDA random 36-character UUID. 6929bb52-3ab2-448a-9796-d6480ecad36b<ins>Numbers, Text, and Colors</ins>
Variable Name Description Example $randomAlphaNumericA random alpha-numeric character. A9X1Z3$randomBooleanA random boolean value. true,false$randomIntA random integer value between 0 and 1000. 29,432,786$randomColorA random color amongst red, green, blue, yellow, purple, and orange. yellow$randomHexColorA random hex value. #f2a729$randomAbbreviationA random abbreviation. SQL,JSON,HTML<ins>Internet and IP addresses</ins>
Variable Name Description Example $randomIPA random IPv4 address 192.168.0.101$randomIPV6A random IPv6 address 2001:0db8:85a3:0000:0000:8a2e:0370:7334$randomMACAddressA random MAC address. 00:1B:44:11:3A:B7$randomPasswordA random 15-character alpha-numeric password. H8w72Sx93KlqA1b$randomLocaleA random two-letter language code (ISO 639-1). en,fr,es$randomUserAgentA random user agent. Mozilla/5.0 (Windows NT 10.0; Win64)$randomProtocolA random internet protocol. https,ftp$randomSemverA random semantic version number. 1.2.3<ins>Names</ins>
Variable Name Description Example $randomFirstNameA random first name. Ethan,Chandler,John$randomLastNameA random last name. Schaden,Schneider,Doe$randomFullNameA random Full name. Ethan Schaden,Chandler Schneider,John Doe$randomNamePrefixA random name prefix. Dr.,Miss.,Prof.$randomNameSuffixA random name suffix. MD,PhD,Jr.<ins>Addresses and Profession</ins>
Variable Name Description Example $randomCityA random city name. New York,Houston,Philadelphia$randomJobAreaA random job area. Intranet,Development,Testing$randomJobDescriptorA random job descriptor. Corporate,Lead,Principal$randomJobTitleA random job title. Global Branding Officer,Productivity Analyst$randomJobTypeA random job type. Manager,Coordinator,Director