title: Google Spreadsheet Script Write Data to Multiple Spreadsheets using javascript
body: <p>I'm trying to expand on the script from:
  "Tutorial: Writing Spreadsheet data using JavaScript Objects"
  <a href="https://developers.google.com/apps-script/articles/writing_spreadsheet_data" rel="nofollow">https://developers.google.com/apps-script/articles/writing_spreadsheet_data</a></p>
  
  <p>I have implemented this script onto our own spreadsheet and am able to read our source spreadsheet and write to a target spreadsheet. Unfortunately I have reached the limit of that tutorial, which coincides precisely with the extent of my knowledge of javascript.</p>
  
  <p>Our goals:
  1) Instead of writing data to a sheet that matches the "department" used in the tutorial, we need to write to a specific target spreadsheet with one sheet that matches the department. 
  2) We need to loop the script to write each department to a unique spreadsheet.</p>
  
  <p>For our purposes we have about 100 "departments", the result we are looking for should be 100 spreadsheets - 1 for each department [just like the sheets that are created in the tutorial] The script does not need to dynamically create a new spreadsheet, although that would be cool...we just need to have it write to the appropriate spreadsheet.</p>
  
  <p>Any help/advice or direction is greatly appreciated.  Thanks</p>