I am trying to retrieve the data from my Google Spreadsheet, but when I try to add the data
object to my htmlTemplate
object, I receive the error
'Object does not allow properties to be added or changed'
My code is pretty simple:
function showDialog() {
var htmlTemplate = HtmlService.createHtmlOutputFromFile('index');
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var range = sheet.getDataRange();
var values = range.getValues(); //get the spreadsheet data
htmlTemplate.data = values; // error here
...
}
Could anyone tell me what is wrong with this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…