I have a sheet with information that needs to be filled and once a submit process is started it should copy the cell data to an existing table header in a document. There is only one table in the document with the header info.
I can get this to work just fine with appendTable, but I would like to append rows to the existing table in the document. Data from spreadsheet looks like [[1234, Jordan, Connecticut], [6899123, Job Site, Connecticut], [, , ]]
// Sheet Data
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0]
var range = sheet.getRange(2,1,sheet.getLastRow(),sheet.getLastColumn());
var rows = sheet.getLastRow()
var values = range.getValues();
var document = DocumentApp.openById(tmpl);
var body = document.getBody();
body.replaceText('#{jobNum}', job);
var table = body.getTables()[0]
document.saveAndClose()