0
0
Google Sheetsspreadsheet~8 mins

Sheets API basics in Google Sheets - Dashboard Guide

Choose your learning style9 modes available
Dashboard Mode - Sheets API basics
Dashboard Goal

Show how to use Google Sheets API to read and update spreadsheet data for a sales report.

Sample Data
ProductRegionSales Q1Sales Q2
ApplesEast100150
OrangesWest200180
BananasEast150130
GrapesWest120170
PearsEast90110
Dashboard Components
  • KPI Card: Total Sales Q1
    Formula: =SUM(C2:C6)
    Result: 660
  • KPI Card: Total Sales Q2
    Formula: =SUM(D2:D6)
    Result: 740
  • Table: Sales by Product and Region
    Shows raw data from the sample table
  • API Read Example: Script to read sales data range 'Sheet1'!A1:D6 using Sheets API
    GET https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/Sheet1!A1:D6
  • API Update Example: Script to update Sales Q2 for Apples to 160
    PUT https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/Sheet1!D2?valueInputOption=USER_ENTERED
    Body: {"values":[[160]]}
Dashboard Layout
+----------------------+----------------------+
|   Total Sales Q1     |    Total Sales Q2    |
|       (660)          |        (740)         |
+----------------------+----------------------+
|                                      |
|          Sales Data Table             |
|                                      |
+--------------------------------------+
Interactivity

User can update sales numbers via Sheets API calls. When data updates, KPI cards and table refresh automatically to show new totals and values.

Self Check

If you update Sales Q2 for Apples from 150 to 160 using the API, which components update?
Answer: Total Sales Q2 KPI card and the Sales Data Table will update to reflect the new value.

Key Result
Dashboard shows total sales and detailed sales data with examples of reading and updating data using Google Sheets API.