Dashboard Mode - Sheets API basics
Dashboard Goal
Show how to use Google Sheets API to read and update spreadsheet data for a sales report.
Show how to use Google Sheets API to read and update spreadsheet data for a sales report.
| Product | Region | Sales Q1 | Sales Q2 |
|---|---|---|---|
| Apples | East | 100 | 150 |
| Oranges | West | 200 | 180 |
| Bananas | East | 150 | 130 |
| Grapes | West | 120 | 170 |
| Pears | East | 90 | 110 |
=SUM(C2:C6)=SUM(D2:D6)'Sheet1'!A1:D6 using Sheets APIGET https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/Sheet1!A1:D6PUT https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/Sheet1!D2?valueInputOption=USER_ENTERED{"values":[[160]]}+----------------------+----------------------+ | Total Sales Q1 | Total Sales Q2 | | (660) | (740) | +----------------------+----------------------+ | | | Sales Data Table | | | +--------------------------------------+
User can update sales numbers via Sheets API calls. When data updates, KPI cards and table refresh automatically to show new totals and values.
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.