title: Postman: iterating through a list in a Pre-request Script
body: <p>I've got the following in a postman pre-request script. Currently I have to have one POST for each userlocation, and each POST defines a separate "searchLoc", so the list below would require 4 posts (my original list is 200 locations). I'm wondering if there is a way to iterate through the list with just one POST. Maybe a folder based pre-request script, but can't figure out how to either walk the list, or repeat the same POST 200 times.</p>
  
  <pre><code>var userLocations = [["WDC","Washington",38.8976,-76.0476],
  ["MEX","Mexico City",19.7665,-100.1692],
  ["MIA","Miami",25.8456,-80.2082],
  ["SFO","San Francisco",37.8236,-122.4217]];
  
  var searchLoc = "DC";
  for ( i=0; i&lt;userLocations.length; i++) {
    if (!userLocations[i].indexOf(searchLoc)) break;
  }
  var username = userLocations[i][0]+"_"+userLocations[i][1];
  var lat = userLocations[i][2];
  var lng = userLocations[i][3];
  
  postman.setEnvironmentVariable("username", username);
  postman.setEnvironmentVariable("lat", lat);
  postman.setEnvironmentVariable("long", lng);
  </code></pre>