Dynamic Variables

Generate random data on the fly with {{random.*}} placeholders. Every request gets unique values.

How to Use

Variable Syntax

Use double curly braces with the random. prefix anywhere in your request — URLs, headers, body, or key:value pairs. The placeholder is replaced with a fresh random value on each request.

# In the URL

tgrs https://api.example.com/users/{{random.uuid}}

# In the body

tgrs POST https://api.example.com/users \

name:{{random.name}} \

email:{{random.email}}

# In headers

tgrs GET https://api.example.com/data -H "X-Request-Id: {{random.uuid}}"

Available Variables

Identity

VariableExample OutputDescription
{{random.uuid}}550e8400-e29b-41d4-a716-446655440000UUID v4
{{random.name}}Sarah JohnsonFull name
{{random.firstName}}SarahFirst name
{{random.lastName}}JohnsonLast name
{{random.email}}sarah.johnson@example.comEmail address

Data Types

VariableExample OutputDescription
{{random.number}}922Random integer (0–1000)
{{random.number(min,max)}}769Random integer within custom range (e.g., 100,999)
{{random.double}}61.41Random decimal (0.0–100.0)
{{random.double(min,max)}}45.58Random decimal within custom range (e.g., 10.0,50.0)
{{random.boolean}}truetrue or false
{{random.string}}hEWlRmYlSdRandom string (10 chars)
{{random.string(N)}}ORsYDRandom string with custom length (max: 50)
{{random.slug}}minim-sed-elitURL-friendly slug (3 words)
{{random.slug(N)}}sed-dolor-lorem-aliqua-quisURL-friendly slug with custom word count (max: 10)
{{random.hex}}a64e03776004a3caHex string (16 chars)
{{random.hex(N)}}b5d50de1ec1e4ecc64b9...Hex string with custom length (max: 64)
{{random.alphanumeric}}lTbGlmYr9BAlphanumeric string (10 chars)
{{random.alphanumeric(N)}}xK2mPAlphanumeric string with custom length (max: 50)

Date & Time

VariableExample OutputDescription
{{random.date}}2025-08-15Date (YYYY-MM-DD)
{{random.datetime}}2025-08-15T14:30:00ZISO 8601 datetime
{{random.time}}14:30:00Time (HH:MM:SS)
{{random.timestamp}}1723728600Unix timestamp

Network & Location

VariableExample OutputDescription
{{random.ip}}192.168.1.42IPv4 address
{{random.ipv6}}2001:db8:85a3::8a2e:370:7334IPv6 address
{{random.url}}https://example.com/pathHTTPS URL
{{random.website}}example.comWebsite domain
{{random.phone}}+1-555-0142Phone number
{{random.city}}San FranciscoCity name
{{random.country}}JapanCountry name

Advanced Usage

Parameterized Variables

Some variables accept parameters in parentheses to control the output.

# String with custom length

tgrs POST https://api.example.com/data key:{{random.string(20)}}

# Number within a range

tgrs POST https://api.example.com/data age:{{random.number(18,65)}}

# Double with range

tgrs POST https://api.example.com/data price:{{random.double(1.0,99.99)}}

# Hex with custom length

tgrs POST https://api.example.com/data token:{{random.hex(64)}}

# Slug with custom length

tgrs POST https://api.example.com/data code:{{random.slug(8)}}

Enum — Pick from a List

Use {{random.enum(a,b,c)}} to randomly pick one value from a comma-separated list.

# Random status

tgrs POST https://api.example.com/orders status:{{random.enum(pending,active,completed)}}

# Random color

tgrs POST https://api.example.com/items color:{{random.enum(red,green,blue,yellow)}}

Custom — Regex Pattern

Use {{random.custom(pattern)}} to generate values matching a regex pattern.

# License plate format

tgrs POST https://api.example.com/vehicles plate:{{random.custom([A-Z]{3}-\d{4})}}

# Product SKU

tgrs POST https://api.example.com/products sku:{{random.custom(SKU-[A-Z]{2}\d{4})}}

Real-World Examples

Create a User with Random Data

tgrs POST https://api.example.com/users \

name:{{random.name}} \

email:{{random.email}} \

phone:{{random.phone}} \

city:{{random.city}}

Idempotency Key

tgrs POST https://api.example.com/payments \

-H "Idempotency-Key: {{random.uuid}}" \

amount:99.99 currency:USD

Timestamped Requests

tgrs POST https://api.example.com/events \

event:click \

timestamp:{{random.timestamp}} \

session_id:{{random.uuid}}

Tip: Dynamic variables are also available in load test specs and flow steps, giving each iteration unique data for realistic testing.