Spread Sheet - error csv

Good morning masters, I have had a huge problem for weeks and I have already lost and reread many documents and videos but I don’t think the solution,
I'm trying to read and delete data from the google sheet but this csv error occurs below I don't know what to do, I really need help is a college job.

VIDEO TUTORIAL

scripts google scripts

function doGet(e) {
return ManageSheet(e);
}

function doPost(e) {
return ManageSheet(e);
}

function ManageSheet(e) {

//READ ALL RECORDS
if ( e.parameter.func == "ReadAll") {
var ss = SpreadsheetApp.getActive();
var sh = ss.getSheets()[0];
var rg = sh.getDataRange().getValues();
var outString = '';
for(var row=0 ; row<rg.length ; ++row){
outString += rg[row].join(',') + '\n';
}
return ContentService.createTextOutput(outString).setMimeType(ContentService.MimeType.TEXT);
}

//DELETE SINGLE RECORD
else if (e.parameter.func == "Delete") {
var record = e.parameter.id;
var ss = SpreadsheetApp.getActive();
//var ss = SpreadsheetApp.openById(e.parameter.ID);
var sh = ss.getSheets()[0];
//var sh = ss.getSheetByName(e.parameter.SH);
sh.deleteRow(parseInt(record) + 1); //makes the correct row to delete (because of header row)
return ContentService.createTextOutput("Success, requested action completed");

}

}



updatedelete.aia (3.0 KB)

Yes, the guy who made the videos has copied (not always very well) all my scripting and blocks from my web site.....

To troubleshoot, the first thing you need to do is add a label, then set the responseContent for Web1.GotText to that label so we can see what is coming back.

The problem can be in:

The spreadsheet
The script
The blocks
Something else

so we need to start with what the script is returning

what is your site with tutorials for me to read?

Don't get distracted, let us see your responseContent.

https://ai2.metricrat.co.uk

and for a the CRUD example:

CRUD with Google Sheets, Web App and AI2

I'm having trouble showing you what you asked for: /
I didn't quite understand what I have to do to show you the responsible

Just this

and show us what is in the label

greetings,

I did what he told me, and when I click to read ... it appears the csv error


You are not sending a GET request with the func parameter.

Try ?func=ReadAll

according to the error message, you are using somewhere in your blocks a list from csv table block... unfortunately we can't see that block in your latest screenshot..

Taifun

image

I used yes, I sent you a photo

sera que possa estar nesse trecho ?

image

you might want to display the response content in a label to find out, what is going on
Taifun

did not work : /

someone could help me, i know they are volunteers but if they can open the aia. that I sent to help me.
the code snippet is small.
I think I will fail in this matter: /
I can't make it work

updatedelete.aia (3.0 KB)

what about following my previous ansnwer to fin dout, what is going on?

If you are asking for help, I recommend you to make it as easy for others to be able to help you ...
You probably will get more feedback then...

which means in your case post a screenshot of your relevant blocks...

To download the aia file, upload it to App Inventor, open it, do some bug hunting for you, etc... this takes time, and most people will not do that...
Thank you.

Taifun


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

There is a problem with your web app. It cannot read the sheet inside the spreadsheet.

TypeError: Cannot read property 'getSheets' of null (line 15, file "Código")

Please show your web app script....

Good Morning ,
I also think that the script is something wrong

Yes, you are calling SpreadsheetApp.getActive() but sending a spreadsheet ID.

Is your web app "bound" to the spreadsheet or is it a standalone script ?

If standalone, you will need to change your script like this:

Change:

var ss = SpreadsheetApp.getActive();

to

var ss = SpreadsheetApp.openById(e.parameter.ID);

based upon your blocks.

You also need to add the func="readAll" to your url - I have told you this already

You also do not need to send a sheet parameter - the script selects the first sheet in the spreadsheet.

You may want to read this:

HOWTO: Create a Google Apps Script Web App bound to a Spreadsheet

and also read the original tutorial that the person who created the youtube guide you followed, "borrowed" (without any accreditation)

CRUD with Google Sheets, Web App and AI2

não deu certo, dessa forma,, vou ler esse tutorial que me enviou

ola bom dia!!

estou segindo esse tutorial e estou em duvidas onde coloco a url da planilha do google nao achei nos blocos.. nesse link https://ai2.metricrat.co.uk/guides/howto-create-a-google-apps-script-web-app-bound-to-a-spreadsheet