Dynamic variables

Dynamic variables that generate a new value each time a request is sent.

Overview

Dynamic variables are built-in variables whose names start with $. Write one as a token, such as {{$guid}} or {{$randomEmail}}, anywhere you can use a variable: the URL, query parameters, headers, the body, auth fields and the values of other variables. Relay offers the same 118 dynamic variables as Postman, with the same names, so requests imported from Postman keep working.

{
  "id": "{{$guid}}",
  "email": "{{$randomEmail}}",
  "createdAt": "{{$isoTimestamp}}"
}

Names are case-sensitive and include the $. To learn how to use them, see Generating dynamic values.

Generated values

Relay generates a value when it sends the request, and each occurrence of a token gets its own value. Two {{$guid}} tokens in one request produce two different IDs, and sending the request again produces new ones. A variable whose value holds a dynamic token, such as a requestId variable set to {{$guid}}, also gets a fresh value each place it's used. In scripts, relay.variables.replaceIn generates values the same way.

Everywhere else, Relay shows the tokens as written: the request preview and generated code keep {{$guid}} rather than a value. Hovering over a token shows the variable's description and an example value.

A variable you define with the same name, such as a $guid variable in an environment, takes precedence over the dynamic variable. Dynamic variables sit below every other scope.

Some values differ from Postman's. Image variables return working URLs: $randomImageUrl uses picsum.photos, the category image variables use loremflickr.com, and $randomAvatarImage uses GitHub avatars. $randomImageDataUri returns a grey 640 × 480 SVG image.

Dates such as $randomDatePast are written in your Mac's time zone.

The examples in the tables below show the kind of value each variable produces. The values you get are random.

Common

VariableDescriptionExample
{{$guid}}A uuid-v4 style GUID.611c2e81-2ccb-42d8-9ddc-2d0bfa65c1b4
{{$timestamp}}The current UNIX timestamp in seconds.1562757107
{{$isoTimestamp}}The current ISO timestamp at zero UTC.2020-06-09T21:10:36.177Z
{{$randomUUID}}A random 36-character UUID.6929bb52-3ab2-448a-9796-d6480ecad36b

Text, numbers and colors

VariableDescriptionExample
{{$randomAlphaNumeric}}A random alpha-numeric character.y
{{$randomBoolean}}A random boolean value.true
{{$randomInt}}A random integer between 0 and 1000.802
{{$randomColor}}A random color.fuchsia
{{$randomHexColor}}A random hex value.#47594a
{{$randomAbbreviation}}A random abbreviation.SQL

Internet and IP addresses

VariableDescriptionExample
{{$randomIP}}A random IPv4 address.241.102.234.100
{{$randomIPV6}}A random IPv6 address.dbe2:7ae6:119b:c161:1560:6dda:3a9b:90a9
{{$randomMACAddress}}A random MAC address.33:d4:68:5f:b4:c7
{{$randomPassword}}A random 15-character alpha-numeric password.t9iXe7COoDKv8k3
{{$randomLocale}}A random two-letter language code (ISO 639-1).ny
{{$randomUserAgent}}A random user agent.Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.9.8; rv:15.6) Gecko/20100101 Firefox/15.6.6
{{$randomProtocol}}A random internet protocol.https
{{$randomSemver}}A random semantic version number.7.0.5

Names

VariableDescriptionExample
{{$randomFirstName}}A random first name.Ethan
{{$randomLastName}}A random last name.Schaden
{{$randomFullName}}A random first and last name.Connie Runolfsdottir
{{$randomNamePrefix}}A random name prefix.Dr.
{{$randomNameSuffix}}A random name suffix.MD

Profession

VariableDescriptionExample
{{$randomJobArea}}A random job area.Mobility
{{$randomJobDescriptor}}A random job descriptor.Forward
{{$randomJobTitle}}A random job title.International Creative Liaison
{{$randomJobType}}A random job type.Supervisor

Phone, address and location

VariableDescriptionExample
{{$randomPhoneNumber}}A random ten-digit phone number.700-008-5275
{{$randomPhoneNumberExt}}A random phone number with extension (12 digits).27-199-983-3864
{{$randomCity}}A random city name.Spinkahaven
{{$randomStreetName}}A random street name.Kuhic Island
{{$randomStreetAddress}}A random street address.5742 Harvey Streets
{{$randomCountry}}A random country.Kazakhstan
{{$randomCountryCode}}A random two-letter country code (ISO 3166-1 alpha-2).CV
{{$randomLatitude}}A random latitude coordinate.55.2099
{{$randomLongitude}}A random longitude coordinate.40.6609

Images

VariableDescriptionExample
{{$randomAvatarImage}}A random avatar image.https://avatars.githubusercontent.com/u/30218384
{{$randomImageUrl}}A URL of a random image.https://picsum.photos/640/480
{{$randomAbstractImage}}A URL of a random abstract image.https://loremflickr.com/640/480/abstract
{{$randomAnimalsImage}}A URL of a random animal image.https://loremflickr.com/640/480/animals
{{$randomBusinessImage}}A URL of a random stock business image.https://loremflickr.com/640/480/business
{{$randomCatsImage}}A URL of a random cat image.https://loremflickr.com/640/480/cats
{{$randomCityImage}}A URL of a random city image.https://loremflickr.com/640/480/city
{{$randomFoodImage}}A URL of a random food image.https://loremflickr.com/640/480/food
{{$randomNightlifeImage}}A URL of a random nightlife image.https://loremflickr.com/640/480/nightlife
{{$randomFashionImage}}A URL of a random fashion image.https://loremflickr.com/640/480/fashion
{{$randomPeopleImage}}A URL of a random image of a person.https://loremflickr.com/640/480/people
{{$randomNatureImage}}A URL of a random nature image.https://loremflickr.com/640/480/nature
{{$randomSportsImage}}A URL of a random sports image.https://loremflickr.com/640/480/sports
{{$randomTransportImage}}A URL of a random transportation image.https://loremflickr.com/640/480/transport
{{$randomImageDataUri}}A random image data URI.data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3…

Finance

VariableDescriptionExample
{{$randomBankAccount}}A random 8-digit bank account number.09454073
{{$randomBankAccountName}}A random bank account name.Home Loan Account
{{$randomCreditCardMask}}A random masked credit card number.3622
{{$randomBankAccountBic}}A random BIC (Bank Identifier Code).EZIAUGJ1
{{$randomBankAccountIban}}A random 15-31 character IBAN (International Bank Account Number).MU20ZPUN3039684000618086155TKZ
{{$randomTransactionType}}A random transaction type.invoice
{{$randomCurrencyCode}}A random 3-letter currency code (ISO-4217).CDF
{{$randomCurrencyName}}A random currency name.CFP Franc
{{$randomCurrencySymbol}}A random currency symbol.£
{{$randomBitcoin}}A random bitcoin address.3VB8JGT7Y4Z63U68KGGKDXMLLH5

Business

VariableDescriptionExample
{{$randomCompanyName}}A random company name.Grady LLC
{{$randomCompanySuffix}}A random company suffix.Inc
{{$randomBs}}A random phrase of business-speak.killer leverage schemas
{{$randomBsAdjective}}A random business-speak adjective.viral
{{$randomBsBuzz}}A random business-speak buzzword.repurpose
{{$randomBsNoun}}A random business-speak noun.markets

Catchphrases

VariableDescriptionExample
{{$randomCatchPhrase}}A random catchphrase.Future-proofed heuristic open architecture
{{$randomCatchPhraseAdjective}}A random catchphrase adjective.Self-enabling
{{$randomCatchPhraseDescriptor}}A random catchphrase descriptor.needs-based
{{$randomCatchPhraseNoun}}A random catchphrase noun.superstructure

Databases

VariableDescriptionExample
{{$randomDatabaseColumn}}A random database column name.updatedAt
{{$randomDatabaseType}}A random database type.tinyint
{{$randomDatabaseCollation}}A random database collation.utf8_general_ci
{{$randomDatabaseEngine}}A random database engine.InnoDB

Dates

VariableDescriptionExample
{{$randomDateFuture}}A random future datetime.Tue Mar 17 2025 13:11:50 GMT+0530 (India Standard Time)
{{$randomDatePast}}A random past datetime.Sat Mar 02 2019 09:09:26 GMT+0530 (India Standard Time)
{{$randomDateRecent}}A random recent datetime.Tue Jul 09 2023 23:12:37 GMT+0530 (India Standard Time)
{{$randomWeekday}}A random weekday.Thursday
{{$randomMonth}}A random month.February

Domains, emails and usernames

VariableDescriptionExample
{{$randomDomainName}}A random domain name.gracie.biz
{{$randomDomainSuffix}}A random domain suffix.org
{{$randomDomainWord}}A random unqualified domain name.gwen
{{$randomEmail}}A random email address.Pablo62@gmail.com
{{$randomExampleEmail}}A random email address from an “example” domain.Talon28@example.com
{{$randomUserName}}A random username.Jarrell.Gutkowski
{{$randomUrl}}A random URL.https://anais.net

Files and directories

VariableDescriptionExample
{{$randomFileName}}A random file name (includes uncommon extensions).neural_sri_lanka_rupee_gloves.gdoc
{{$randomFileType}}A random file type (includes uncommon file types).model
{{$randomFileExt}}A random file extension (includes uncommon extensions).war
{{$randomCommonFileName}}A random file name.well_modulated.mpg4
{{$randomCommonFileType}}A random, common file type.application
{{$randomCommonFileExt}}A random, common file extension.m2v
{{$randomFilePath}}A random file path./home/programming_chicken.cpio
{{$randomDirectoryPath}}A random directory path./usr/bin
{{$randomMimeType}}A random MIME type.audio/vnd.vmx.cvsd

Stores

VariableDescriptionExample
{{$randomPrice}}A random price between 0.00 and 1000.00.531.55
{{$randomProduct}}A random product.Towels
{{$randomProductAdjective}}A random product adjective.Unbranded
{{$randomProductMaterial}}A random product material.Steel
{{$randomProductName}}A random product name.Handmade Concrete Tuna
{{$randomDepartment}}A random commerce category.Tools

Grammar

VariableDescriptionExample
{{$randomNoun}}A random noun.matrix
{{$randomVerb}}A random verb.parse
{{$randomIngverb}}A random verb ending in “-ing”.synthesizing
{{$randomAdjective}}A random adjective.auxiliary
{{$randomWord}}A random word.withdrawal
{{$randomWords}}Some random words.Samoa Synergistic sticky copying Grocery
{{$randomPhrase}}A random phrase.You can't program the monitor without navigating the mobile XML program!

Lorem ipsum

VariableDescriptionExample
{{$randomLoremWord}}A random word of lorem ipsum text.est
{{$randomLoremWords}}Some random words of lorem ipsum text.vel repellat nobis
{{$randomLoremSentence}}A random sentence of lorem ipsum text.Molestias consequuntur nisi non quod.
{{$randomLoremSentences}}A random 2 to 6 sentences of lorem ipsum text.Et sint voluptas similique iure amet perspiciatis vero sequi atque. Ut porro sit et hic. Neque aspernatur vitae fugiat ut dolore et veritatis.
{{$randomLoremParagraph}}A random paragraph of lorem ipsum text.Ab aliquid odio iste quo voluptas voluptatem dignissimos velit. Recusandae facilis qui commodi ea magnam enim nostrum quia quis. Nihil est suscipit assumenda ut voluptatem sed.
{{$randomLoremParagraphs}}3 random paragraphs of lorem ipsum text.Voluptatem rem magnam aliquam ab id aut quaerat. Placeat provident possimus voluptatibus dicta velit non aut quasi. Mollitia et aliquam expedita sunt dolores nam consequuntur.…
{{$randomLoremText}}A random amount of lorem ipsum text.Quisquam asperiores exercitationem ut ipsum. Aut eius nesciunt. Et reiciendis aut alias eaque.
{{$randomLoremSlug}}A random lorem ipsum URL slug.eos-aperiam-accusamus
{{$randomLoremLines}}1 to 5 random lines of lorem ipsum.Ducimus in ut mollitia. A itaque non. Harum temporibus nihil voluptas.

See Also

  • Generating dynamic values: Fill requests with fresh IDs, timestamps and sample data each time they're sent.
  • Using variables: Insert values into requests with {{name}} tokens and see where each value comes from.
  • Scripting API: The objects and functions available to request scripts.