Integrations

Google Sheets

The Google Sheets integration allows you to automatically send responses to a Google Sheet of your choice.

Connect Google Sheets

  1. Go to the Integrations tab in your Formbricks Cloud dashboard and click on the "Connect" button under Google Sheets integration.
Formbricks Integrations Tab
  1. Now click on the "Connect with Google" button to authenticate yourself with Google.
Connect Formbricks with your Google
  1. You will now be taken to the Google OAuth page where you can select the Google account you want to use for the integration.

  2. Once you have selected the account and completed the authentication process, you will be taken back to Formbricks Cloud and see the connected status as below:

Formbricks is now connected with Google
  1. Now click on the "Link New Sheet" button to link a Google Sheet with Formbricks and a modal will open up.
Link Formbricks with a Google Sheet
  1. Select the Google Sheet you want to link with Formbricks and the Survey. On doing so, you will be asked with what questions' responses you want to feed in the Google Sheet. Select the questions and click on the "Link Sheet" button.
Select question to link with Google Sheet
  1. On submitting, the modal will close and you will see the linked Google Sheet in the list of linked Google Sheets.
List of linked Google Sheets

Congratulations! You have successfully linked a Google Sheet with Formbricks. Now whenever a response is submitted for the linked survey, it will be automatically added to the linked Google Sheet.

Remove Integration with Google Account

To remove the integration with Google Account,

  1. Visit the Integrations tab in your Formbricks Cloud dashboard.
  2. Select Manage Sheets button in the Google Sheets card.
  3. Click on the Delete Integration button.
  4. It will now ask for a confirmation to remove the integration. Click on the Delete button to remove the integration. You can always come back and connect again with the same Google Account.
Delete Google Integration with Formbricks

Setup in self-hosted Formbricks

Integrating Google Sheets with a self-hosted Formbricks instance requires configuring Google Cloud and updating your environment variables. This guide provides step-by-step instructions to facilitate this setup using Google Cloud Project & OAuth Setup.

  1. Go to the Google Cloud Console and create a new project.

  2. Enable necessary APIs:

    • Now select the project you just created and go to the APIs & Services section.
    • Click on the Enable APIs and Services button and search for Google Sheets API & Google Drive API and enable it.
  3. Configure OAuth Consent Screen:

    • Go to OAuth Consent screen and select the appropriate User Type (External or Internal). Select Internal if you want only the users of your Google Workspace to be able to use the integration.
    • Fill the required details:
      • App name: Name displayed during OAuth authentication.
      • User support email and Developer contact information: Your contact details for support.
    • Click on Save and Continue.
  4. Add required Scopes:

  • Click on the Add or Remove Scopes button and add the scopes:
    • https://www.googleapis.com/auth/userinfo.email
    • https://www.googleapis.com/auth/spreadsheets
    • https://www.googleapis.com/auth/drive
  • Click on the Update button. Verify the scopes and click on the Save and Continue button.
  • Skip the Test Users section and click on the Save and Continue button.
  1. View the OAuth Consent Screen summary and click on the Back to Dashboard button.

  2. Register OAuth Client:

  • Navigate to Credentials > Create Credentials > OAuth Client ID.
  • Select Web Application and set:
    • Name: Name of the OAuth Client ID.
    • Authorized JavaScript Origins: https://<your-public-facing-url>
    • Authorized redirect URIs: https://<your-public-facing-url>/api/google-sheet/callback
  • Save and note the Client ID and Client Secret.
  1. Copy the Client ID and Client Secret and set them as environment variables in your Formbricks instance:

    • GOOGLE_SHEETS_CLIENT_ID
    • GOOGLE_SHEETS_CLIENT_SECRET
    • GOOGLE_SHEETS_REDIRECT_URL
  2. Enable Google Drive API:

    • Go to the APIs & Services section and click on the Enable APIs and Services button.
    • Search for Google Drive API and enable it.

By now, your environment variables should include the below ones as well:

  • GOOGLE_SHEETS_CLIENT_ID
  • GOOGLE_SHEETS_CLIENT_SECRET
  • GOOGLE_SHEETS_REDIRECT_URL

Voila! You have successfully enabled the Google Sheets integration in your self-hosted Formbricks instance. Now you can follow the steps mentioned in the Formbricks Cloud section to link a Google Sheet with Formbricks.

What info do you need?

  • Your Email ID for authentication (We use this to identify you)
  • Your Google Sheets Names and IDs (We fetch this to list and show you the options of choosing a sheet to integrate with)
  • Write access to selected Google Sheet (The google sheet you choose to integrate it with, we write survey responses to it)

For the above, we ask for:

  1. User Email: To identify you (that's it, nothing else, we're opensource, see this in our codebase here)
  2. Google Drive API: To list all your google sheets (that's it, nothing else, we're opensource, see this method in our codebase here)
  3. Google Spreadsheet API: To write to the spreadsheet you select (that's it, nothing else, we're opensource, see this method in our codebase here)

Still struggling or something not working as expected? Join our Discord! and we'd be glad to assist you!

Was this page helpful?