100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Testing

Dynamic Variables and Faker Data

How to use Postman's built-in dynamic variables like {{$guid}} and {{$randomEmail}} to generate realistic fake data on every request.

ScriptingBeginner7 min readJul 10, 2026
Analogies

What Are Dynamic Variables?

Dynamic variables are Postman's built-in tokens, always prefixed with a dollar sign like {{$guid}}, {{$timestamp}}, or {{$randomInt}}, that resolve to a fresh value every single time the request is sent — no scripting required. Under the hood they're powered by the faker.js library bundled into Postman, which is why they can produce realistic-looking names, emails, addresses, and dates rather than just raw random numbers.

🏏

Cricket analogy: A ball-tracking system generates a fresh trajectory prediction for every single delivery bowled, never reusing yesterday's data for today's Hawk-Eye reading.

Common Dynamic Variables

Some of the most frequently used tokens are {{$randomEmail}}, {{$randomFullName}}, {{$randomInt}}, {{$isoTimestamp}}, and {{$guid}}, and they can be dropped directly into a URL, header, or JSON body. Their main practical value is generating unique test data on demand — for example, using {{$randomEmail}} in a signup request body avoids 'email already registered' failures when the same request runs across dozens of Collection Runner iterations.

🏏

Cricket analogy: An IPL auction assigns a unique player ID to every trialist so no two players' stats get mixed up in the database, even if two share the same name.

json
{
  "fullName": "{{$randomFullName}}",
  "email": "{{$randomEmail}}",
  "username": "{{$randomUserName}}",
  "age": {{$randomInt}},
  "signupId": "{{$guid}}",
  "registeredAt": "{{$isoTimestamp}}"
}

Typing {{$ in any URL, header, or body field opens Postman's autocomplete with the full catalog of dynamic variables, grouped by category — Person, Internet, Date/Time, Commerce, and more — all backed by the bundled faker.js library.

Generating Custom Fake Data with pm.variables and Faker in Scripts

When a single {{$...}} token isn't enough — say you need an array of fake line items, or you need the same generated value to appear consistently in two different fields — you drop into a pre-request script, build the data with JavaScript logic, and store it with pm.variables.set() so multiple fields in the request can reference the exact same generated value.

🏏

Cricket analogy: A groundskeeper custom-prepares a pitch with specific grass length and moisture for a day-night Test, going beyond the standard pitch report template.

Every {{$randomInt}}, {{$guid}}, or similar token is re-resolved independently each time it appears, including across multiple occurrences in the same request and across every Collection Runner iteration. Don't assume two separate {{$randomInt}} tokens in one request body will produce the same number — capture the value once with pm.variables.set() in a pre-request script if you need to reuse it.

  • Dynamic variables are built-in tokens prefixed with $ (e.g. {{$guid}}, {{$randomEmail}}) that resolve to a fresh value on every send, no scripting required.
  • They're powered by the faker.js library bundled into Postman, covering categories like Person, Internet, Date/Time, and Commerce.
  • Typing {{$ in any field triggers autocomplete listing every available dynamic variable.
  • Common examples: {{$guid}}, {{$timestamp}}, {{$isoTimestamp}}, {{$randomInt}}, {{$randomEmail}}, {{$randomFullName}}.
  • They're ideal for avoiding data collisions in test data, like unique emails or IDs, across repeated Collection Runner iterations.
  • For more control than a single token, generate custom fake data in a pre-request script and store it with pm.variables.set() so the same generated value can be reused across multiple fields.

Practice what you learned

Was this page helpful?

Topics covered

#Testing#PostmanStudyNotes#TestingQA#DynamicVariablesAndFakerData#Dynamic#Variables#Faker#Data#StudyNotes#SkillVeris