Not sure where you problem is, it is working OK for me.
You do not need the blocks to remove the first item in the list as you do not have a header row.
Check the single quotes around Sheet1 in your script, make sure they are the straight down ones that you would get when typing in the script editor, not the ones copied from a community post, which may make them curly ones
Hey this worked. Thanks a ton.
One more question. I have one ore question, I have a button. when I click it sends the data and append in the row. But when I click the button again, it appends the data is same column.
I want to append data to a new column every time I click the button. Any suggestions on that?
Just for the record, given you did not share your solution…:
function doPost(e) {
var ss = SpreadsheetApp.getActive();
var sh = ss.getSheetByName('Sheet1');
var nc = sh.getLastColumn() + 1;
var rows = JSON.parse(e.postData.contents);
var irl = rows[0].length;
sh.insertColumns(nc,irl);
for (var i=0;i<rows.length;i++) {
var range = sh.getRange(i+1,nc, 1, irl);
range.setValues([rows[i]]);
}
return ContentService.createTextOutput("Success") ;
}
Your script only inserts the 1st item of each set, this may be because you reach the end of the columns. You at least need to insert columns as well, or use my script to post the entire range.