title: Postman getting random UserName inside Pre-Request Scripts
body: <p>I'm wanting to generate a random user to be created using the API, every time I run the request.</p>
  
  <p>I have an email environment variable which I want to be set to a random email every time the user create request is sent.</p>
  
  <p><strong>I currently have:</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>pm.environment.set("Email", pm.globals.get("$randomUserName") + "@myDomain.co.uk");
  </code></pre>
  
  <p>I'm wanting to get a <a href="https://learning.postman.com/docs/postman/variables-and-environments/variables-list/" rel="nofollow noreferrer">random user name</a> from <code>$randomUserName</code></p>
  
  <p><strong>However</strong>, I can't seem to find out how to get a value from $randomUserName in the Pre-Request Scripts section.</p>