Integrations

Google Sheets

Send form submissions to Google Sheets automatically.

The Google Sheets integration appends form submissions as rows in a Google Spreadsheet. It uses OAuth 2.0 for authentication and Google Drive Picker for spreadsheet selection.

Features

  • OAuth 2.0 authentication with automatic token refresh
  • Google Drive Picker popup for visual spreadsheet selection
  • Checkbox-based field selection (choose which fields to send)
  • Metadata fields: Submission ID, Date, IP Address, User Agent

Setup

Google Cloud Console

  1. Create a project at Google Cloud Console
  2. Enable these APIs:
    • Google Sheets API
    • Google Drive API
    • Google Picker API
  3. Create an OAuth 2.0 Client ID (Web application)
  4. Create an API Key and restrict it to Google Picker API
  5. Add your redirect URI to authorized redirect URIs

Environment Variables

.env
FILAFORMS_GOOGLE_SHEETS_ENABLED=true
FILAFORMS_GOOGLE_CLIENT_ID=your-id.apps.googleusercontent.com
FILAFORMS_GOOGLE_CLIENT_SECRET=your-secret
FILAFORMS_GOOGLE_API_KEY=your-api-key

Redirect URI

Register this exact URL in Google Cloud Console:

Production:

https://your-domain.com/filaforms/connections/oauth/callback

Local development (with fwd.host):

https://fwd.host/http://your-site.test/filaforms/connections/oauth/callback

For local development, also set:

.env
FILAFORMS_OAUTH_CALLBACK_URL=https://fwd.host/http://your-site.test/filaforms/connections/oauth/callback

User Flow

  1. Admin connects a Google account on the Integrations page (OAuth)
  2. On a form's integration settings, adds a Google Sheets integration
  3. Selects the connected Google account from the dropdown
  4. Clicks Select a Google Spreadsheet to open the Drive Picker popup
  5. Picks a spreadsheet from the popup -- selection is saved via postMessage, popup closes automatically
  6. Enters the sheet tab name (defaults to "Sheet1")
  7. Selects which form fields and metadata to include via checkboxes
  8. On form submission, data appends as a new row in the spreadsheet

OAuth Scopes

The integration requests these Google OAuth scopes:

  • https://www.googleapis.com/auth/spreadsheets -- Read/write spreadsheet data
  • https://www.googleapis.com/auth/drive.readonly -- Browse spreadsheets in Drive Picker
  • https://www.googleapis.com/auth/userinfo.email -- Display connected account email

Routes

MethodURIPurpose
GET/filaforms/connections/oauth/redirect/{connection}Start Google OAuth flow
GET/filaforms/connections/oauth/callbackOAuth callback
GET/filaforms/google-sheets/picker/{connection}Open Drive Picker popup

Troubleshooting

"The API developer key is invalid" : Enable the Google Picker API in Cloud Console and add it to your API key restrictions.

404 on OAuth authorization : Ensure you're using the correct endpoint: https://accounts.google.com/o/oauth2/v2/auth (not /authorize).

Redirect URI mismatch : The redirect URI must be registered as exactly https://your-domain.com/filaforms/connections/oauth/callback. Google Cloud Console settings can take 5 minutes to several hours to propagate after changes.

Spreadsheet picker not opening : Ensure a connected Google account is selected in the "Connected Account" dropdown. The picker requires a valid OAuth connection.

Missing scopes after OAuth : If the user doesn't grant all requested permissions, the connection is rejected. Re-connect and grant all requested scopes (Sheets, Drive, email).

Copyright © 2026