Skip to content

Instantly share code, notes, and snippets.

@mattash
Created November 1, 2013 18:40
Show Gist options
  • Save mattash/7269866 to your computer and use it in GitHub Desktop.
Save mattash/7269866 to your computer and use it in GitHub Desktop.
Google Spreadsheet AppScript that publishes JSON of a Sum
function getTickets() {
var sheet = SpreadsheetApp.openById("SPREADSHEET_ID").getSheetByName("SHEET_NAME_WITH_SUM");
var count = sheet.getRange("LOCATION_OF_CELL");
return count.getValue();
}
function doGet() {
var result = {
"TITLE_OF_SUM":this.getTickets()
}
return ContentService.createTextOutput(JSON.stringify(result)).setMimeType(ContentService.MimeType.JSON);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment