Google Sheets Integration

Cloud setup

If your Retool dashboard is located at https://username.retool.com, where username is your username, you're using cloud-hosted Retool.

1. Authorize access to your Google Sheets Account

See Cloud setup.

2. Querying Google Sheets for data

Follow our Google Sheets tutorial.


On-premise setup

1. Setup Google Login

You'll need to enable Google Login to connect Google Sheets. Docs.

šŸ“˜

What if I'm already using Okta SSO?

If you are already using Okta SSO, you can safely authorize Google SSO without presenting an additional sign in method. Retool will only display one SSO button on the login page and Okta has priority over Google when both are enabled.

2. Enable required services

Navigate to The Google Console and select your Retool project.

Search for the following three services, in the Library dashboard, and enable all of them:

  • Google+ API
  • Google Drive API
  • Google Sheets API

3. Authorize access to your Google Sheets Account

Navigate to your settings page in Retool, and then press Add resource.

Select Google Sheets in the dropdown of integrations. Give it a name, and then press Authorize Google Sheets.

4. Querying Google Sheets for data

Follow our Google Sheets tutorial.

FAQs

When I query a spreadsheet all the values are returned as strings (for example "0.05"). How do convert these strings to numbers for graphing and other transformations?

Depending on how data is formatted in the spreadsheet the Google Sheets API will return every value as a string. You can use the query Transformer field to parse out the number fields so you can use them across your app without additional casting or parsing. Add this snippet to any Google Sheets query and you're good to go!

const dataAsObject = formatDataAsObject(data)
const parsedData = {}
_.each(dataAsObject, function(v,k){
Ā  parsedData[k] = v.map(d=> isNaN(d) ? d: Number(d))
})
return parsedData

Using a query transformer to parse numerical values in a Read data Google Sheets query response

Updated 12 days ago


Google Sheets Integration


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.