title: Can I use postman collection variable inside newman?
body: <p>Using variables from scope: collection inside Postman works fine.</p>
  
  <p>But when I export collection and use it inside Newman it does not work as I expected.</p>
  
  <p>1) Variabes are inside collection json, in the end of file - ok.</p>
  
  <p>2) I use this code:</p>
  
  <pre><code>var obj = {};
  obj.categories = pm.variables.get("category_id");
  obj.packages = pm.variables.get("package_id"); 
  obj.type = "add";
  pm.globals.set("switch_json", JSON.stringify(obj));
  console.log("request body: " + pm.globals.get("switch_json"));
  </code></pre>
  
  <p>in pre-request script to get value of 2 collection variables (category_id, package_id).</p>
  
  <p>3) Inside Postman all works fine, console.log return:</p>
  
  <blockquote>
    <p>request body: {"categories":"14","packages":"2","type":"add"}</p>
  </blockquote>
  
  <p>4) Inside Newman console.log return only:</p>
  
  <blockquote>
    <p>'request body: {"type":"add"}'</p>
  </blockquote>
  
  <p>Does it mean Newman do not support collection variables?</p>