解決方法:寫入睡眠function 在觸發條件的function底下 function autoUpdate(e) { // Set a comment on the edited cell to indicate when it was changed. var range = e.range; Utilities.sleep(120000); setUpCalendar() }
附上程式碼
function autoUpdate(e) {
var id = '網址id';
var spreadsheet = SpreadsheetApp.openById(id);
var sheet = spreadsheet.getSheets()[2]; // 要第幾個sheet? 0 就是第一個
var range = e.range;
var new_row = range.getLastRow();
var data = sheet.getRange(new_row,3,1,13).getValues();
setUpCalendar(data)
}