Dynamic variables

Dynamic variables can be used in the request builder like this:

_images/dynamic-variables.png

If you want to use dynamic variables in scripts, you can use the replaceIn starting with Postman v7.6.0.

pm.variables.replaceIn('{{$randomFirstName}}');

pm.variables.replaceIn('{{$randomFirstName}} {{$randomLastName}}');

The replaceIn method will return a String with the resolved variables.

Before Postman 7.2, only the following dynamic variables were available:

Variable name Description Example
$guid Generates a GUID (Globally Unique Identifier) in v4 15aacbb1-1615-47d8-b001-e5411a044761
$timestamp Returns the current timestamp 1561013396
$randomInt Generates random integer between 0 and 1000 764

Starting with version 7.2, Postman is using the faker.js library and added more variables. If used multiple times, they can return different values per request. Note: the autocomplete support in the Request Builder might be missing.

Variable name Description Examples Comment
$randomCity City East Ryanfurt, Jenkinsview  
$randomStreetName Street name Mckenna Pines, Schiller Highway, Vandervort Pike [1]
$randomStreetAddress Street with number 98165 Tanya Passage, 0695 Monahan Squares [2]
$randomCountry Country Belgium, Antarctica (the territory South of 60 deg S)  
$randomCountryCode Country code (2-letter) GY, TK, BG  
$randomLatitude Latitude -79.9881, 87.8072  
$randomLongitude Longitude -41.5763, 10.4960  
$randomColor Color lime, azure, maroon, gold, violet  
$randomDepartment Departments in a store Garden, Clothing, Grocery, Kids  
$randomProductName Product name Intelligent Steel Sausages, Awesome Rubber Cheese  
$randomPrice Price 244.00, 301.00 [3]
$randomProductAdjective Product adjective Refined, Handcrafted, Handmade, Sleek  
$randomProductMaterial Product material Frozen, Cotton, Wooden, Soft  
$randomProduct Simple product name Salad, Cheese, Bike, Soap  
$randomCompanyName Company name Christiansen LLC, Corwin Inc, Fahey - Boyer  
$randomCompanySuffix Company suffix LLC, Group, Inc, and Sons  
$randomCatchPhrase Catch phrase Centralized upward-trending attitude  
$randomBs BS one-to-one unleash communities  
$randomCatchPhraseAdjective Catch phrase adjective Total, Diverse, Horizontal  
$randomCatchPhraseDescriptor Catch phrase descriptor leading edge, dynamic, attitude-oriented  
$randomCatchPhraseNoun Catch phrase noun Graphical User Interface, matrix, benchmark  
$randomBsAdjective BS adjective compelling, vertical, revolutionary  
$randomBsBuzz BS buzz strategize, redefine, streamline  
$randomBsNoun BS noun systems, bandwidth, paradigms  
$randomDatabaseColumn Database column status, title, name, password, createdAt  
$randomDatabaseType Database column type enum, mediumint, double, timestamp  
$randomDatabaseCollation Database collation utf8_general_ci, utf8_bin  
$randomDatabaseEngine Database engine MEMORY, InnoDB, CSV, MyISAM  
$randomDatePast Date in the past Wed Mar 06 2019 04:17:52 GMT+0800 (WITA)  
$randomDateFuture Date in the future Wed Nov 20 2019 20:26:40 GMT+0800 (WITA)  
$randomDateRecent Recent date Thu Jun 20 2019 13:29:11 GMT+0800 (WITA)  
$randomMonth Month February, April  
$randomWeekday Weekdat Saturday, Monday  
$randomBankAccount Bank account (8-digit) 58484223, 18983115  
$randomBankAccountName Bank account name Home Loan Account, Investment Account  
$randomCreditCardMask Masked credit card number (4-digit) 7333, 6202  
$randomCurrencyAmount Amount 297.80, 529.26  
$randomTransactionType Transaction type invoice, deposit, withdrawal, payment  
$randomCurrencyCode Currency code THB, HTG USD, AUD  
$randomCurrencyName Currency name Pound Sterling, Bulgarian Lev  
$randomCurrencySymbol Currency symbol $, лв, Kč  
$randomBitcoin ??? 1URwKxDpfEkTYNGYfKBZUWcuavqbSL  
$randomBankAccountIban IBAN PK46Y5057900541310025311 [6]
$randomBankAccountBic BIC YQCIFMA1762 [7]
$randomAbbreviation Abbreviation RSS, SQL, TCP, HTTP, SMS  
$randomAdjective Adjective virtual, solid state, digital  
$randomNoun Noun microchip, interface, system, firewall  
$randomVerb Verb connect, parse, navigate, synthesize  
$randomIngverb Verb with -ing bypassing, copying, programming  
$randomPhrase Phrase We need to copy the online CSS microchip!  
$randomAvatarImage Avatar image URL https://s3.amazonaws.com/uifaces/faces/twitter/jacksonlatka/128.jpg  
$randomImageUrl Image URL http://lorempixel.com/640/480  
$randomAbstractImage Abstract image http://lorempixel.com/640/480/abstract  
$randomAnimalsImage Image with animals http://lorempixel.com/640/480/animals  
$randomBusinessImage Business-related image http://lorempixel.com/640/480/business  
$randomCatsImage Image with cats http://lorempixel.com/640/480/cats  
$randomCityImage Image with a city http://lorempixel.com/640/480/city  
$randomFoodImage Image with food http://lorempixel.com/640/480/food  
$randomNightlifeImage Image with nightlife http://lorempixel.com/640/480/nightlife  
$randomFashionImage Image with fashion http://lorempixel.com/640/480/fashion  
$randomPeopleImage Image with people http://lorempixel.com/640/480/people  
$randomNatureImage Image with nature http://lorempixel.com/640/480/nature  
$randomSportsImage Image with sport http://lorempixel.com/640/480/sports  
$randomTransportImage Image with transportation http://lorempixel.com/640/480/transport  
$randomImageDataUri Image as data URI data:image/svg+xml;charset=UTF-8,%3Csvg%20  
$randomEmail Email from popular email providers Mable_Crist@hotmail.com, Ervin47@gmail.com [8]
$randomExampleEmail Example email Ayla.Kozey27@example.net, Adrian.Hickle@example.com  
$randomUserName Username Minerva42, Shania_Nitzsche  
$randomProtocol HTTP Protocol http, https  
$randomUrl URL http://daphney.biz, https://ansley.com  
$randomDomainName Domain name adaline.org, murray.name, abdul.biz  
$randomDomainSuffix Top Level Domain (TLD) extension com, net, biz, name, org  
$randomDomainWord Word that can be used within a domain name guadalupe, willa, jose  
$randomIP IP v4 147.236.215.88, 139.159.148.94  
$randomIPV6 IP v6 64d7:f61e:d265:167f:3971:9ae3:6853:3c48  
$randomUserAgent Browser User-agent Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 5.2; Trident/5.1)  
$randomHexColor Color in hex format #010638, #010638  
$randomMACAddress MAC address 15:12:78:1e:96:fe, 99:f4:aa:40:49:59  
$randomPassword Password v_Ptr4aTaBONsM0, 8xQM6pKgBUndK_J  
$randomLoremWord Lorem ipsum word ipsa, dolor, dicta  
$randomLoremWords Lorem ipsum words debitis tenetur deserunt  
$randomLoremSentence Lorem ipsum phrase Qui fugiat necessitatibus porro quasi ea modi.  
$randomLoremSlug Lorem ipsum slug sint-dolorum-expedita, modi-quo-ut  
$randomLoremSentences Lorem ipsum sentance Voluptatum quidem rerum occaecati …  
$randomLoremParagraph Lorem ipsum paragraph Asperiores dolor illo. Ex …  
$randomLoremParagraphs Lorem ipsum paragraphs Saepe unde qui rerum … [9]
$randomLoremText Lorem ipsum text Ipsam repellat qui aspernatur … [10]
$randomLoremLines Lorem ipsum text aliquid enim reiciendis … [11]
$randomFirstName First name Dillan, Sedrick, Daniela  
$randomLastName Last name Schamberger, McCullough, Becker  
$randomFullName Full name Layne Adams, Bridget O’Reilly III  
$randomJobTitle Job title Product Usability Consultant, Product Mobility Architect  
$randomNamePrefix Personal title (used as prefix) Miss, Mrs., Mr., Ms  
$randomNameSuffix Title (used as suffix) I, II, Sr., MD, PhD  
$randomNameTitle Job title Product Markets Administrator, Internal Functionality Producer [12]
$randomJobDescriptor Job title descriptor Corporate, Global, International, Chief, Lead  
$randomJobArea Job area Creative, Markets, Tactics  
$randomJobType Job type Administrator, Consultant, Supervisor  
$randomPhoneNumber Phone number 946.539.2542 x582, (681) 083-2162 [13]
$randomPhoneNumberFormat Phone number 840-883-9861, 353-461-5243 [14]
$randomPhoneFormats Phone number format ###.###.####, 1-###-###-#### x###, (###) ###-####  
$randomArrayElement Random element from array [a,b, c] a, b, c  
$randomObjectElement Random object element car, bar  
$randomUUID UUID 1f9a0bc0-582c-466f-ba78-67b82ebbd8a8  
$randomBoolean Boolean true, false [15]
$randomWord Word or abbreviation transmitting, PCI, West Virginia  
$randomWords Words portal bypassing indigo, Cotton transmitting [16]
$randomLocale Locale en  
$randomAlphaNumeric Alphanumeric character 4, a, h  
$randomFileName Filename soft_smtp.wvx, calculate.grv  
$randomCommonFileName Common filename mall.pdf, chair.mp4, facilitator.mp3  
$randomMimeType MIME type application/x-font-bdf, application/omdoc+xml  
$randomCommonFileType Common filetype image, application, audio  
$randomCommonFileExt Common file extension png, mp3, mpeg, gif  
$randomFileType File type x-shader, font, audio, message  
$randomFileExt File extension xsm, zirz, xar  
$randomDirectoryPath Directory path    
$randomFilePath File path    
$randomSemver Version (using semantic version) 6.3.4, 2.8.0, 1.7.6  
[1]Limited usability as you cannot specify a country.
[2]Warning: it may generate invalid data, with street numbers starting with 0. Limited usability as you cannot specify a country.
[3]Not possible to specify a format. It seems that the price is never with a subdivision (cents). Alternative: $randomCurrencyAmount.
[6]May not be a valid IBAN.
[7]May not be a valid BIC.
[8]Better use example emails.
[9]Includes \n \r characters (CR + LF).
[10]Length is unpredictable. May include \n \r characters (CR + LF).
[11]Length is unpredictable. May include \n characters (LF).
[12]Seems to overlap with $$randomJobTitle.
[13]Random format. Cannot specify a format / country.
[14]Fixed format. Cannot specify another format / country
[15]Warning: the output is still a string!
[16]May return only one word.