Spread Sheet - error csv

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

Hello good Morning!!
I'm following this tutorial and I'm in doubt where I put the url of the google spreadsheet I didn't find in the blocks

That is because, as per the title of the howto, the web app is being created "bound" to the spreadsheet, therefore you only need to call SpreadsheetApp.getActive() in the web app

I now merged the 2 threads
Taifun

Dear sir,
Your CRUD-GS-AI2 is a fantastic one. Excellent work made by you. I have one doubt in it. Can we use text boxes and labels instead of lvLabel and lvContent (List view). Then how to modify the Update block? Please help sir

You may want to look at the improved version:

Google Sheet CRUDQ II

Yes, you can use which ever components (that will take the data) to return your spreadsheet data into. You then have to modify your blocks to handle the data and any update methods.

1 Like

Yes. Great...
Thank you sir.

While updating a Google sheet record, Is there any chance to skip a perticular column?. Because I have set an complicated formula on that Google sheet column and so sometimes I have to update through Google sheet also. Perhaps I set formula in app inventor, I am unable to update directly in Google sheet. Because There will be no formula in that column... Any idea sir

You can use the gviz query method to return specific columns:

Ok sir... I try it.

Thx very much, is realy simple and amazing.
Is possible to read or modify some other sheet of the same file?

Thx in advance.

Yes, you set the gid or the sheetname.

Where should I enter the sheet name in the script or MIT App Inventor to read the 1st the 2nd or another sheet?

You need to show me your script (in text please) and blocks

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.openById(e.parameter.ID);
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.name;
var ss = SpreadsheetApp.openById(e.parameter.ID);
var sh = ss.getSheets()[0];
sh.deleteRow(parseInt(record) + 1);
return ContentService.createTextOutput("Success");
}
//READ SINGLE RECORD
else if ( e.parameter.func == "ReadRecord") {
var ss = SpreadsheetApp.openById(e.parameter.ID);
var sh = ss.getSheets()[0];
var rg = sh.getDataRange().getValues();
var outString = '';
outString += rg[parseInt(e.parameter.id)].join('§');
return ContentService.createTextOutput(outString).setMimeType(ContentService.MimeType.TEXT);
}
//UPDATE SINGLE RECORD
else if (e.parameter.func == "Update") {
var ss = SpreadsheetApp.openById(e.parameter.ID);
var sh = ss.getSheets()[0];
var data = [ [ e.parameter.name, e.parameter.phone ] ];
sh.getRange("B"+(parseInt(e.parameter.id)+1)+":C"+(parseInt(e.parameter.id)+1)).setValues(data);
return ContentService.createTextOutput("Success");
}
}

Is like you say before.
In script i've to change
var ss = SpreadsheetApp.getActive();
to
var ss = SpreadsheetApp.openById(e.parameter.ID);

Thx very much for the help.