/google-dashboard

Connect and display Google Sheets data as a web-based dashboard with controls

GNU Affero General Public License v3.0AGPL-3.0

Google Dashboard

Connect and display Google Sheets data as a web-based dashboard with controls (cfr. https://developers.google.com/chart/interactive/docs/gallery/controls#dashboard).

Google Apps Script

Examples

Instructions

Based on https://ctrlq.org/code/20094-google-charts-dashboard-with-google-sheets.

Code.gs file

// Code.gs file in Google App Scripts
function doGet(e) { 
  return HtmlService
  .createTemplateFromFile("index")
  .evaluate()
  .setTitle("Google Spreadsheet Chart")
  .setSandboxMode(HtmlService.SandboxMode.IFRAME);
}

function getSpreadsheetData() {
  var ssID   = "1dKEgrMoLJyF2AcL3gKx-vM_fmHLWMyJKI0E_xW3aMpo",
      sheet  = SpreadsheetApp.openById(ssID).getSheets()[0],
      data   = sheet.getDataRange().getValues();
  
  // use this to show data in the Logger console in Google App Scripts 
  //Logger.clear();
  //Logger.log(data);
  
  return data;    
}

index.html file

TODO

TODO

  • add screenshots
  • add testcase