title: SuiteScript - Map/Reduce summarize
body: <p>I am writing a map/reduce script to search for a custom record and create a CSV file from its results.
  Firstly, in the getInputData() creating a search and returning its results.
  After that comes the map function where I am using JSON.parse to parse the result values.</p>
  <p>I have an array declared globally as <code>var data = ''</code> in which I am pushing the values I get in map function.
  But when all the looping ends in map() and it enters summarize(), the data array becomes empty again.</p>
  <p>I want that data array to be called in summarize() where I can use <code>file.create()</code> function to create the csv file.</p>
  <p>I used <code>return data;</code> in map() but it is showing as empty when in summarize().</p>