google apps script - is it possible to use getRowsData without a range? -
i using google app scrips , want iterate through spreadsheet updated weekly. (this why dont want set range want able iterate through entire sheet.)
is possible? if yes can give example of how done?
and if isn't idea, why not?
thank you!
example code
function doget(e){ var ss = spreadsheetapp.openbyid('key in here'); var sheet = ss.getsheetbyname("form responses"); var range = sheet.getrange(1,1); var datarange = range.getvalue().tostring(); app.add(app.createhtml("there " + datarange + " posts today")) return app;
something this, want able see whole sheet not range
henrique abreu , srik provided correct answer - getdatarange on sheet should serve purpose.
function doget(e){ var sheet = spreadsheetapp.openbyid('spreadsheetid').getsheetbyname('sheetname'); var data = sheet.getdatarange().getvalues();; ... }
data 2-dimensional array, can iterate through it, last column/row containing content etc. please read through class reference here: https://developers.google.com/apps-script/reference/spreadsheet/sheet
Comments
Post a Comment