Sending data from a google sheet to another and delete the date from the first google sheet

Any help for my blocks please

the first main google sheet web that data will be deleted from after getting the full data and sending

the second google sheet web after arranging and getting the full data

the third google sheet web that the full data should be send after getting all data again
image

Did you get any error message? what's that?
and what is your variable url2?

You can use appscript as well to achieve this.

@Taifun
i fixed blocks when i adjusted them like that

i just need a help with that delete where query


delete where D='' and E='' and K='' and G='' and I=''

1 Like

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

And remember

Use the companion app and Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

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=''

again: this is not what you are doing, you are sending all queries at the same time to the database

unknown

use Do it and show us your Do it result
EDIT: as you are using local variables, you also can use a label to display the query

also what is the response content after trying to delete?

Taifun

ok will try but let me show you what i did


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

it can be something like that

i used that block before for deleting using script
image

but after the query equation data is not deleting the exact row as it needs to delete where the selected row existed

or if there is a delete where equation can be added to the script it will work indeed

@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

Taifun

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!

here is the label data after delete where query

In your first screenshot you are doing it, see my next post below

What's that? Very strange...
You should be able to display your query in a label to check if the query makes sense. .

Taifun

In your first screenshot rhere are 3 queries, which will be executed at the same time... not good...

Taifun