Skip to content

Instantly share code, notes, and snippets.

@dt
Created March 29, 2019 03:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dt/39f7988a0906569a59fbb2b45322bb85 to your computer and use it in GitHub Desktop.
Save dt/39f7988a0906569a59fbb2b45322bb85 to your computer and use it in GitHub Desktop.
google append to sheet
var f = SpreadsheetApp.openById('1ZPixvI2lBGPTC-3YmmtbRqEJHU5-A02k9Jfhpw2vw9Q');
var sheet = f.getSheetByName('Sheet1');
function doPost(e) {
Logger.log(e);
console.log(e);
parsedData = JSON.parse(e.postData.contents);
var nextFreeRow = sheet.getLastRow() + 1;
sheet.appendRow([parsedData.co2]);
SpreadsheetApp.flush();
return ContentService.createTextOutput("ok");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment