Your data
is in the actual format that's required in the sheet:
function myFunction() {
var ss = SpreadsheetApp.getActiveSpreadsheet()
var data = [['Mr. Gerald', 'Monday', '2:10'],
['Mr. Holmes', 'Tuesday', '3:00']];
var dataSheet = ss.getActiveSheet();
dataSheet.getRange(1,1,data.length,data[0].length).setValues(data); //or use Advanced Google Services
}
If data
is not of square/rectangular shape, Use Advanced Google services:
var request = {
range: dataSheet.getName() + '!A1',
majorDimension: 'ROWS',
values: data,
};
//API must be enabled before use.
//https://developers.google.com/apps-script/advanced/sheets
Sheets.Spreadsheets.Values.update(request, ss.getId(), request.range, {
valueInputOption: 'USER_ENTERED',
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…