This is not what you are doing
You are sending all queries at the same time
If you really want to first get some data and after getting that data, then delete something, you should send the delete query in the Web GotText event of the first query
i got all data unsing the query and sent it to another google sheet, all i want now is to fix the delete where query equation so after getting the data by select where equation and sending it using the above block as it helped me to send all where data with no need to select the listview selection if you remember, so all i want no is to delete where eqution as that one doesnt work
delete where D='' and E='' and K='' and G='' and I=''
in the first screen shot,
i got all data by where equation sending to the web name استيراد خارجي 2
then in the web after getting all components to the second listview, i send these data to the driver sheet in the second screen shot,
as you remember
mustafa egypt usa num 1
taifun egypt usa num 2
so after getting
egypt usa sum num 3 using the second screen shot method, there is no need to
send each row manually, just sending all by clicking on the listview 1 selection where is select where equation
i used that method instead of trying to select all elements in the listview 2 and it worked well,
so i wanna delete where equation same as i send in the screenshot 2
@Taifun lets adjust that script equation to try that method
else if (e.parameter.func == "Deletewhere") {
var ss = SpreadsheetApp.getActive();
var sh = ss.getSheets()[0];
var dataRange = sh.getDataRange();
var values = dataRange.getValues();
for (var i = values.length - 1; i >= 0; i--) {
if (
values[i][3] != "" && // Column D
values[i][4] != "" && // Column E
values[i][10] != "" && // Column K
values[i][6] != "" && // Column G
values[i][8] != "" // Column I
) {
sh.deleteRow(i + 1);
}
}
return ContentService.createTextOutput("Success");
}
this is the delete equation i used , its deleting but not the exact values which needs where existed values selected in the listview
//DELETE SINGLE RECORD
else if (e.parameter.func == "Delete") {
var record = e.parameter.id;
var ss = SpreadsheetApp.getActive();
var sh = ss.getSheets()[0];
sh.deleteRow(parseInt(record) + 1);
return ContentService.createTextOutput("Success");
unfortunately you make it very difficult to help...
and you do not follow the suggestions, which results in a waste of not only your time, but also of those who like to help
as said already twice, now the third time: you are sending all queries at the same time to the database... so if you select some data and delete that data at the same time unexpected things will happen...
why do you want to use an apps script to delete now? why are you mixing different concepts? why not using gviz as earlier?
first select the data, then in the Web.GotText event receive the data and do something else, for example to delete the data
you also failed to provide a Do it result of the delete query and of the raw response content after trying to delete
am not sending multiple queries at the same time, the sum arranging query in the screen inilalize, while that delete query is a button click, plus i dont understand the concept of do it, here is the do it result for the label but not showing anything in the label, Am a beginner in that site so most of things i do know is learning it by searching and trying!