Data read modify Googlesheet Sheet3

Now written up:

1 Like

I have moved all your subsequent posts here

Lot if thanks your help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :blush: :blush: :blush: :blush: :blush: :blush: :blush: :blush: :blush: :blush:

i try it and i have message :cry: :cry: when i click read all button:

I paste my sheet ID and sheetname is it okay? Or i not work good? :frowning: Thanks your help!!!!!

  1. You did not need to edit the google apps script (This was the whole point of the exercise)
  2. You set the sheetId (the id of the spreadsheet) and the sheetname (the specific sheet in the spreadsheet) in the variables in the app
1 Like

Ohhhh :scream:. Okaaay i tryyyy

Processing: Screenshot_2022-09-18-19-57-22-433.jpeg...

I not Edit tud script i get this message when I click readall btn

you have added wrong values in base url and sheet id ..

Pls read the @TIMAI2 guide properly.. There is no way to mis use the blocks. Everything were oerfectly placed.

I am surprised, How do you misread this blocks

2 Likes

Thank You.

Sorry I think I put link okaaay i try without😊

1 Like

I try but cant work :frowning:


You have some problem with your script url code. Compare your script url with Timai2 script url.

Your url doesnot contain macros.. So your code returns html page with error

Run the base url in browser and capture the result and oaste here. Maybe Tim will help you further.

Also why do you edit this code? You should not.

Here SHEET ID and SHRET NAME text only should come.

function doGet(e) {

var ss = SpreadsheetApp.openById(e.parameter.SHEETID);
var sh = ss.getSheetByName(e.parameter.SHEETNAME);
var rg = sh.getDataRange().getValues();

//READ ALL RECORDS
if ( e.parameter.FN == "ReadAll" ) {
return ContentService.createTextOutput(JSON.stringify(rg)).setMimeType(ContentService.MimeType.JSON);
}

//READ SINGLE RECORD
else if ( e.parameter.FN == "ReadRecord" ) {
var ref = sh.getRange(parseInt(e.parameter.ROWID)+1,1,1,rg[0].length).getValues();
return ContentService.createTextOutput(JSON.stringify(ref)).setMimeType(ContentService.MimeType.JSON);
}

//DELETE SINGLE RECORD
else if ( e.parameter.FN == "Delete" ) {
sh.deleteRow(parseInt(e.parameter.ROWID) + 1);
return ContentService.createTextOutput("Record Deleted");
}

//UPDATE SINGLE RECORD
else if ( e.parameter.FN == "Update" ) {
var data = JSON.parse('[' + e.parameter.DATA + ']');
sh.getRange(parseInt(e.parameter.ROWID) + 1,1,1,data[0].length).setValues(data);
return ContentService.createTextOutput("Record Updated");
}

//CREATE NEW RECORD
else if ( e.parameter.FN == "Create" ) {
var data = JSON.parse(e.parameter.DATA);
sh.appendRow(data);
return ContentService.createTextOutput("New Record Appended");
}

}

Have you deploy it properly? Using anyone option?

Read here

1 Like


Yes its anyone

Yeah, now your script url is correct.. Copy that url and paste into the blocks and try..

Meanswhile furst run the base url in any web browser and see the result

1 Like

Not work :frowning:

Just now i have tested.. No issue.. I created a empty sheet, paste the csv data and script code, deploy it and paste the script url, sheet id and name.. It gives back me result as shown in the video

As @TIMAI2 and i said, you made wrong somewhere else

On running your script url in browser, Do you get response like this?

test my sample aia
HKFix_blank(1).aia (9.2 KB)

Sheet Link

1 Like

Your spreadsheet ID does not look long enough...?

Good Morning!

I delete my all try (6projects) and i start new time :smiley: AND IT WOOOORK!!!!!!!!!!!

Dear everybody!!!!
LOT OF THANKS!!!!!!!

THANK YOU THANK YOU THANK YOUUUUUU!!!!!!!! :blush: :blush: :blush: :blush: :blush: :blush: :innocent: :innocent: :innocent: :innocent: :innocent: :innocent:

1 Like