Cloud Migration Resources
Planning a Cloud migration? These resources can help you get started:
→ Dashboard Hub Cloud features – Review Cloud features and understand key differences between DC and Cloud.
→ Migration support from Appfire – Learn how we can help you migrate smoothly.
Google spreadsheet
Overview
The Google spreadsheet template lets you render a table in your dashboard based on data from a connected Google spreadsheet.
It uses the Google Spreadsheets API and processes cells to form an array based on the headers.
Requirements
This template uses an API key; you don’t need to configure a datasource.
Google sheet: The spreadsheet must be shared with Viewer permissions set to Anyone with the link.
Google Cloud project
Google API key
Dashboard Hub dashboard
Setup
Create the Google spreadsheet
Go to
Google Sheets: Online Spreadsheets & Templates | Google Workspace. Select Blank spreadsheet.
Enter a name for the spreadsheet so you can share it later.
Add the data you want to display in the dashboard:
Enter the column headers in the first row, for example,
Product,Description,Category.Add the corresponding data in the subsequent rows.
Copy the spreadsheet ID from the URL; you will need it later. For example, in the URL format:
<https://docs.google.com/spreadsheets/d/{SPREADSHEET_ID}/edit>, whereSPREADHSHEET_ID=1Fl8TqeZigVHGuAFxXTgGgra_DSUq0nXTMbWQOZCRNdA.
Make your spreadsheet public
Click Share in the top right of the spreadsheet.
Select Anyone with the link. If the Google Sheets account belongs to an organization, for example, a work or school account, this option isn’t available.
Set permission to Viewer.
Click Done.
The spreadsheet must be publicly readable for API key authentication to work. If you need help with sharing a file publicly, see Google’s support documentation.
Create a Google Cloud project
Go to Google Cloud console.
Click Select Project.
In the Select a resource page, click New project.
In the New Project page, enter a project name, then click Create.
Select the new project in the Select a resource page to open the project.
Create a Google Sheets API key
Go to Google Sheets API in the Google console.
Click Enable.
Click Create credentials, then select API key. A key will be generated.
Copy the API key. You will need this later.
On the Edit API key page, select Restrict key.
Select the Google Sheets API.
(optional) Under Application restrictions, select the relevant restriction you want to apply, for example, IP addresses.
Add the Google Spreadsheet gadget to your dashboard
Navigate to your Dashboard Hub dashboard.
Click Edit.
Click Add Gadget.
Navigate to the Custom Reports section in the left side navigation panel.
Locate the Google Spreadsheet gadget, click Add, and click Open Editor.
Configure the table
Determine what data you want to display from your Google spreadsheet and edit the URI line in the editor. Use the format:
{SheetName}!{StartCell}:{EndCell}
Examples:A1:Z42: Reads columns A through Z, rows 1 through 42.Sheet1!A1:Z100: Reads from a specific sheet.A1:Z: Reads all rows in columns A through Z.Build the API URL. Combine the sheet ID, table values, and API key that you created in Google Cloud console. Use the following format:
https://sheets.googleapis.com/v4/spreadsheets/{SPREADSHEET_ID}/values/{RANGE}?key={API_KEY}
Example:
https://sheets.googleapis.com/v4/spreadsheets/1Fl8TqeZigVHGuAFxXTgGgra_DSUq0nXTMbWQOZCRNdA/values/A1:Z42?key=AIzaSyAl5NAfVNCXP4MIgsaFH4WYsVt7_6J-59gHow to test the API integration
Copy your complete URL.
Paste it into a web browser.
You should see JSON data with your spreadsheet values.
If you get an error, check the following:
The Google spreadsheet is set to Anyone with the link can view.
The API key is correct. You can confirm this by checking the Credentials in your Google project.
The Google Sheets API is enabled.
The spreadsheet ID and range are correct.
Troubleshooting
Error | Solution |
|---|---|
| Make sure the spreadsheet is publicly shared |
| Check your spreadsheet ID and range format |
| Verify your API key is correct and the Sheets API is enabled |
| Check the spreadsheet ID exists and is accessible |