Skip to main content

1. Get Google Cloud Credentials through a Service Account

For Service Account authentication, follow Google's documentation to obtain your private key.

You'll want to configure the Service Account with the Storage Admin Role.

Make sure to export as JSON!

2. Add to Retool

Create a new resource in Retool, and select "Google Cloud Storage" as the type. Enter a label by which you want to refer to this integration. If you're using Service Account authentication, enter your service account private key in the box provided Press "Save" when you're done. Resources > Add > Google Cloud Storage

3. Configuring Your Bucket

If you want to be able to upload files to a GCS Bucket you'll have to configure the CORS feature in GCS.

Here's an example of a JSON CORS file that you might use to enable Retool to access your Google Cloud Storage bucket. If your Retool instance isn't hosted on retool.com, you need to adjust the origin accordingly.

[
{
"origin": ["https://*.retool.com"],
"responseHeader": ["Content-Type", "x-goog-acl"],
"method": ["GET", "HEAD", "POST", "PUT", "DELETE"],
"maxAgeSeconds": 3600
}
]

And then you can run the following command to set the CORS setting on the bucket.

gsutil cors set cors-file.json gs://your-bucket-name
note

First install gsutil. After that, you'll want to run gcloud init and then login into your Google Cloud account

4. Create Queries

You can now select your newly-created GCS resource from the Resource dropdown when creating queries in your Retool apps.

Many of the operations are directly transferrable from our S3 Integration, however see below for an example of a Filepicker uploading files to GCS.