//CRUD Web App for Google Sheets and AppInventor function doGet(e){ return CRUDHandler(e); } function doPost(e){ return CRUDHandler(e); } function CRUDHandler(e) { //lock sheet to prevent concurrent changes var lock = LockService.getPublicLock(); lock.waitLock(20000); //CREATE NEW RECORD if (e.parameter.func == "Create") { var ss = SpreadsheetApp.getActive(); var sh = ss.getSheets()[0]; var headers = sh.getRange(1,1,1,sh.getLastColumn()).getValues(); var newdata = [[]]; for (var i=0;i