, . :
function prependRow(sheet, rowData) {
sheet.insertRowBefore(1).getRange(1, 1, 1, rowData.length).setValues([rowData]);
}
, , , .
function insertRow(sheet, rowData, optIndex) {
var index = optIndex || 1;
sheet.insertRowBefore(index).getRange(index, 1, 1, rowData.length).setValues([rowData]);
}
appendRow , . , . , lock , :
function insertRow(sheet, rowData, optIndex) {
var lock = LockService.getScriptLock();
lock.waitLock(30000);
try {
var index = optIndex || 1;
sheet.insertRowBefore(index).getRange(index, 1, 1, rowData.length).setValues([rowData]);
SpreadsheetApp.flush();
} finally {
lock.releaseLock();
}
}
, , ..
function getValuesFromForm(form){
insertRow(sheet, [order,lastName,firstName]);
}