Import google spreadsheet data to google doc app script -
i trying google app script import google spreadsheet data google doc. haven't found in checking api. possible import data doc? how?
function createdocfromsheet(){ var ss = spreadsheetapp.getactivespreadsheet(); var sheet = ss.setactivesheet(ss.getsheets()[2]); var values = ss.getdatarange().getvalues() for(n=2;n<=values.length;++n){ var cell = sheet.getrange(n,3).getvalue(); var row = sheet.getrange(n,2,1,5).getvalues(); var newdoc = documentapp.create(cell); var body = newdoc.getbody(); body.insertparagraph(0,row); newdoc.saveandclose(); } }
Comments
Post a Comment