Data read modify Googlesheet Sheet3

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