简体   繁体   中英

Delete spreadsheet data by using google scripts

i'm trying to delete a specific row in google spreadsheet by using google scripts. I have created separate html page in order to inter the row id.But when I run the program I'm getting this error.

{"result":"error","error":{"message":"Cannot find method deleteRow((class)).","name":"InternalError","fileName":"Code","lineNumber":52,"stack":"\\tat Code:52 (handleResponse)\\n\\tat Code:18 (doGet)\\n"}}

Here is my source code and I have created java script file in the same folder and external html file References- https://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/

This will delete a row.

function drow()
{
  var sht=SpreadsheetApp.getActiveSheet();
  var response = SpreadsheetApp.getUi().prompt('Delete Row', 'Enter Row Number to Delete', SpreadsheetApp.getUi().ButtonSet.OK);
  var rownum = Number(response.getResponseText());
  sht.deleteRow(rownum);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM