Overview

Dynamic variables allow you to generate random, unique data on-the-fly without writing scripts. Perfect for load testing, creating test data, and avoiding hardcoded values.

Auto-Generated: Dynamic variables generate fresh values every time you send a request. No manual intervention needed!
✨ Dynamic Variables $guid a1b2c3d4-e5f6-7890 Random GUID/UUID $timestamp 1699876543 Current Unix timestamp $randomEmail john.doe@example.com Random email address $randomInt 7542 Random integer 0-1000 $randomName Jane Smith Random full name

Available Dynamic Variables

Request Man provides 9 built-in dynamic variables. Simply use them anywhere in your requests:

Variable Description Example Output
{{$guid}} UUID v4 (GUID) a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6
{{$timestamp}} Unix timestamp (seconds) 1732627200
{{$isoTimestamp}} ISO 8601 timestamp 2025-11-26T12:34:56.789Z
{{$randomInt}} Random integer (0-1000) 527
{{$randomUUID}} Another UUID v4 f7e8d9c0-1a2b-4c5d-8e9f-0a1b2c3d4e5f
{{$randomAlphaNumeric}} Random alphanumeric (10 chars) aB3dEf9GhI
{{$randomBoolean}} Random boolean true or false
{{$randomIP}} Random IPv4 address 192.168.1.100
{{$randomEmail}} Random email address user_abc123@example.com

How to Use Dynamic Variables

In URL

GET https://api.example.com/users/{{$guid}}
GET https://api.example.com/data?timestamp={{$timestamp}}
https://api.example.com/users/ {{$guid}} https://api.example.com/users/a1b2c3d4-e5f6-7890

In Headers

X-Request-ID: {{$guid}}
X-Timestamp: {{$timestamp}}
X-Trace-ID: {{$randomUUID}}
Headers KEY VALUE X-Request-ID {{$guid}} X-Timestamp {{$timestamp}} X-Trace-ID {{$randomUUID}}

In JSON Body

{
  "id": "{{$guid}}",
  "timestamp": {{$timestamp}},
  "email": "{{$randomEmail}}",
  "age": {{$randomInt}},
  "active": {{$randomBoolean}},
  "ip_address": "{{$randomIP}}",
  "session_id": "{{$randomAlphaNumeric}}"
}
Important: Don't use quotes around {{$timestamp}}, {{$randomInt}}, or {{$randomBoolean}} in JSON - they output raw numbers/booleans!
Body { "id": {{$guid}} , "email": {{$randomEmail}} , "name": {{$randomName}} , "timestamp": {{$timestamp}} , "age": {{$randomInt}} , "active": {{$randomBoolean}} } ✨ Values change with each request

In Query Parameters

page={{$randomInt}}
id={{$guid}}
timestamp={{$timestamp}}

Practical Examples

Example 1: User Registration Testing

Create unique users without manually changing email addresses:

POST https://api.example.com/users
Content-Type: application/json

{
  "id": "{{$guid}}",
  "email": "{{$randomEmail}}",
  "username": "user_{{$randomAlphaNumeric}}",
  "created_at": {{$timestamp}},
  "is_active": {{$randomBoolean}},
  "ip_address": "{{$randomIP}}"
}
POST /api/users/register { "user_id": "3f2b9a7c-d4e1-8f56" "email": "jane.smith@example.com" "username": "jane.smith" "phone": "+1-555-123-4567" "age": 28 "ip_address": "192.168.1.42" "created_at": 1699876543 } Response: ✓ 201 Created - User registered successfully!

Example 2: Order Creation (Load Testing)

Generate unique orders for load testing:

POST https://api.example.com/orders
Content-Type: application/json

{
  "order_id": "{{$guid}}",
  "transaction_id": "{{$randomUUID}}",
  "customer_id": {{$randomInt}},
  "amount": {{$randomInt}},
  "timestamp": {{$timestamp}},
  "created_at": "{{$isoTimestamp}}",
  "confirmed": {{$randomBoolean}}
}
Request #1 Request #2 Request #3 Request #4 order_id: "a1b2c3d4-e5f6" • user_id: "7890" order_id: "f9e8d7c6-b5a4" • user_id: "3210" order_id: "5a6b7c8d-9e0f" • user_id: "1234" order_id: "2b3c4d5e-6f7a" • user_id: "8901" amount: $142.50 • timestamp: 1699876543 amount: $87.25 • timestamp: 1699876789 amount: $215.00 • timestamp: 1699877021 amount: $63.75 • timestamp: 1699877245 ✓ Status: 201 Created Each request generates unique values automatically

Example 3: API Request Tracking

Add unique identifiers to track requests:

GET https://api.example.com/data
X-Request-ID: {{$guid}}
X-Timestamp: {{$timestamp}}
X-Trace-ID: {{$randomUUID}}
X-Client-IP: {{$randomIP}}

Example 4: A/B Testing with Random Flags

Randomly enable/disable features:

POST https://api.example.com/feature-flags
Content-Type: application/json

{
  "user_id": "{{$guid}}",
  "new_ui_enabled": {{$randomBoolean}},
  "beta_features": {{$randomBoolean}},
  "experimental_mode": {{$randomBoolean}},
  "timestamp": {{$timestamp}}
}
POST /api/feature-flags { "user_id": "3f2b9a7c-d4e1-8f56", "new_ui_enabled": true , "beta_features": false , "experimental_mode": true , "dark_mode": false , "timestamp": 1699876543 } ✨ Random boolean values for A/B testing

Uniqueness & Freshness

Fresh Generation Every Time

Dynamic variables generate new values for each request:

First Request

{"id": "aaaa-bbbb-cccc-dddd", "email": "user_abc@example.com"}

Second Request (Same Configuration)

{"id": "1111-2222-3333-4444", "email": "user_xyz@example.com"}

Third Request

{"id": "9999-8888-7777-6666", "email": "user_def@example.com"}
Request #1 {"id": "aaaa-bbbb-cccc-dddd", "email": "user_abc@example.com"} Request #2 {"id": "1111-2222-3333-4444", "email": "user_xyz@example.com"} Request #3 {"id": "9999-8888-7777-6666", "email": "user_def@example.com"} Same request, different values each time!

Multiple Variables in Same Request

Each occurrence generates a unique value:

{
  "order_id": "{{$guid}}",          // aaaa-bbbb-cccc-dddd
  "transaction_id": "{{$guid}}",    // 1111-2222-3333-4444
  "session_id": "{{$guid}}"         // 9999-8888-7777-6666
}

All three GUIDs will be different!

Load Testing with Dynamic Variables

Collection Runner Integration

Use dynamic variables with Collection Runner for powerful load testing:

Create Request with Dynamic Variables

POST https://api.example.com/orders
{
  "order_id": "{{$guid}}",
  "user_id": {{$randomInt}},
  "timestamp": {{$timestamp}}
}

Add to Collection

Save the request to a collection.

Run with Iterations

In Collection Runner, set iterations to 1000.

Collection Runner Collection: 📁 API Load Test Iterations: 1000 ← Each with unique data!

Result

1000 unique orders created with different IDs, user IDs, and timestamps!

Running Load Test... ✓ 1000 / 1000 Orders Created 1000 All with unique IDs! Success Rate 100% 0 failures
Perfect for Load Testing: Each iteration gets fresh dynamic values, simulating real users with unique data!

Combining with Other Variables

Mix dynamic variables with environment and collection variables:

Example: Multi-Environment Testing

POST {{baseUrl}}/api/users
Content-Type: application/json
Authorization: Bearer {{authToken}}

{
  "id": "{{$guid}}",
  "email": "{{$randomEmail}}",
  "timestamp": {{$timestamp}},
  "environment": "{{env_name}}"
}
Variable Type Variable Value
Environment {{baseUrl}} https://api.example.com
Environment {{authToken}} Bearer_abc123...
Environment {{env_name}} production
Dynamic {{$guid}} a1b2... (fresh each time)
Dynamic {{$randomEmail}} user_xyz@... (fresh each time)
Dynamic {{$timestamp}} 1732627200 (fresh each time)
POST {{baseUrl}}/api/users Authorization: Bearer {{authToken}} { "environment": {{env_name}} , // Environment "user_id": {{$guid}} , // Dynamic "email": {{$randomEmail}} , // Dynamic "api_key": {{apiKey}} , // Collection "timestamp": {{$timestamp}} // Dynamic } ✨ Dynamic values change per request, others stay constant!

Testing Generated Values

Use test scripts to validate dynamic variable output:

UUID Format Validation

// Test that GUID is valid UUID format
rm.test("GUID is valid UUID", function () {
    const jsonData = rm.response.json();
    const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
    rm.expect(jsonData.id).to.match(uuidRegex);
});

Timestamp Validation

// Test that timestamp is recent (within last 5 seconds)
rm.test("Timestamp is recent", function () {
    const jsonData = rm.response.json();
    const now = Math.floor(Date.now() / 1000);
    rm.expect(jsonData.timestamp).to.be.closeTo(now, 5);
});

Email Format Validation

// Test that email is valid format
rm.test("Email is valid", function () {
    const jsonData = rm.response.json();
    const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
    rm.expect(jsonData.email).to.match(emailRegex);
});

Boolean Type Validation

// Test that boolean is actual boolean type
rm.test("Active is boolean", function () {
    const jsonData = rm.response.json();
    rm.expect(jsonData.active).to.be.a('boolean');
});
✓ All Tests Passed - 6/6 GUID format is valid 23ms Email format is valid 18ms Timestamp is a valid number 12ms Random int is between 0-1000 15ms Boolean value is true or false 8ms

Dynamic Variables vs. Scripts

Feature Dynamic Variables Pre-request Scripts
Ease of Use ✅ Very Easy - Just type {{$guid}} ⚠️ Requires JavaScript knowledge
Speed ✅ Instant ⚠️ Script execution overhead
Customization ❌ Limited - fixed formats ✅ Fully customizable
Common Use Cases ✅ Perfect for standard data ✅ Perfect for complex logic
Learning Curve ✅ None ⚠️ Need to learn syntax

When to Use Dynamic Variables

When to Use Scripts Instead

Tips & Best Practices

1. Remove Quotes for Numbers

Use {{$timestamp}} not "{{$timestamp}}" in JSON for proper number type.

2. Use for Load Testing

Combine with Collection Runner iterations for powerful load tests with unique data.

3. Track with GUIDs

Use {{$guid}} in headers like X-Request-ID for request tracing.

4. Test Validation

Add test scripts to verify dynamic variable formats are correct.

5. Mix with Environment Vars

Combine dynamic variables with environment variables for flexible testing.

6. Check Console

View generated values in console to debug and verify output.