var ss = SpreadsheetApp.openByUrl("https://docs.google.com/spreadsheets/d/1XHbx_3PmTUHA8GB2mnrMR4j7TCi4X6uS5-1fVKi3_iI/edit#gid=0");var sheet = ss.getSheetByName("Sheet1");
function doGet(e){ var action = e.parameter.action; if(action == "pass") return Password(e); }
function doPost(e){ var action = e.parameter.action; if(action == "pass") return Password(e); }
function Password(e){ var id = e.parameter.id; var values = sheet.getRange(2,1,sheet.getLastRow(),1).getValues(); for(var i = 0 ; i<values.length ; i++){ if(values[i][0] == id){ i=i+2; var paswrd = e.parameter.Password; sheet.getRange(i,3).setValue(paswrd); return ContentService.createTextOutput("Thank You ! Password Update").setMimeType(ContentService.MimeType.TEXT); } } return ContentService.createTextOutput("Id Not Found").setMimeType(ContentService.MimeType.TEXT);}
I try all step by step...
Thanks for your fast response...its work...
Im very glad this forum help me alot...
var ss = SpreadsheetApp.openByUrl("https://docs.google.com/spreadsheets/d/1XHbx_3PmTUHA8GB2mnrMR4j7TCi4X6uS5-1fVKi3_iI/edit#gid=0");var sheet = ss.getSheetByName("Sheet1");
function doGet(e){ var action = e.parameter.action;
var hapus = e.parameter.hapus; if(action == "ubah"){ return Rubah(e); } if(action == "hapus"){ return Hapus(e);
}}
function doPost(e){ var action = e.parameter.action;
if(action == "ubah") return Rubah(e); if(action == "hapus"){ return Hapus(e); }}
function Rubah(e){ var Kont = e.parameter.kontainer; var values = sheet.getRange(2,1,sheet.getLastRow(),2).getValues();
for(var i = 0 ; i<values.length ; i++){
if(values[i][1] == Kont){
i=i+2; var paswrd = e.parameter.Password;
var ket = e.parameter.Keterangan; sheet.getRange(i,4).setValue(paswrd); sheet.getRange(i,5).setValue(ket); return ContentService.createTextOutput("Thank You ! Updated").setMimeType(ContentService.MimeType.TEXT);
} } return ContentService.createTextOutput("Id Not Found").setMimeType(ContentService.MimeType.TEXT);}
function Hapus(e){ var Kont = e.parameter.kontainer; var values = sheet.getRange(2,1,sheet.getLastRow(),2).getValues();
for(var i = 0 ; i<values.length ; i++){
if(values[i][1] == Kont){ sheet.deleteRow(i); return ContentService.createTextOutput("Berhasil Hapus").setMimeType(ContentService.MimeType.TEXT); } }}