title: Issue using forEach on google script
body: <p>Hi I have a syntax error on a GoogleScript. this is my first script ever so I'm not really sure why is not working. The idea is to pick up information from a google sheet and create a label from a doc template and storage it in a folder</p>
  <pre><code>function readSheet() {
  
  const labelFolder = DriveApp.getFolderById(&quot;1NTnJgjCewcFcrtMsl5DtRgrvFUNCdsvt&quot;); 
  
  const docFile = DriveApp.getFileById(&quot;1pRy9BLDuDka7-9PKnHGgO1AtgpoWIY45t7ypVhXXM8I&quot;);
  
  const sheet = SpreadsheetApp.gettActiveSpreadSheet().getSheetByName(&quot;test&quot;);
  
  const data = sheet.getRange(2,1,sheet.getLastRow()-1,10).getValues();
  
    data.forEach(row =&gt; {
  
        shippinglabels(row [5],row [6],row [8],docFile,labelFolder);
  });
  
  }
  
  function shippinglabels(user,address,package,docFile,labelFolder) {
     
    
    const labelFile = docFile.makeCopy(labelFolder);
  
    const tempDocFile = DocumentApp.openById(labelFile.getId());
  
    const body = tempDocFile.getBody();
  
    body.replaceText(&quot;{user}&quot;, user);
  
    body.replaceText(&quot;{address}&quot;, address);
  
    body.replaceText(&quot;{package}&quot;, package);
  
    tempDocFile.setName(user);
  
    tempDocFile.saveAndClose(); 
    
  
       
      }
  </code></pre>
  <p>Thanks</p>