← Documentation

Google Sheets

Google Sheets is a spreadsheet application and part of the free, web-based Google Docs Editors suite offered by Google. The app allows users to create and edit files online while collaborating with other users in real-time. With Forms Bridge you can get your web forms bridged to your spreadsheet files and work with your web leads out of the WordPress admin site.

The addon

The Google Sheets API is a RESTful interface that lets you read and modify a spreadsheet’s data. The Sheets API lets you read and write spreadsheet cell values. To talk with this API the addon implements a custom bridge class. In addition, the addon comes with a contact form templates as a bridge example.

Credential

To work properly this addon requires you to create a service account credentials to grant access to Forms Bridge to your spreadsheets. To create this kind of credential, you have to go to Google Cloud Resource Manager page and create a new project (if you have not done yet so). To create a new project, click on + Create project on the toolbar, open the project form and set the project name and, optionally, the owner organization.

Now go the project admin page and on the left side menu go to APIs and services > Enabled APIs and services and click on the + Enabled APIs and services button on the top bar to get to the APIs library. Once there, search for Google Sheets API and enable the service.

Do the same process with the Google Drive API service.

Now you have a project on Google Cloud with the Google Sheets API and Google Drive API enabled. The next step is to create the credentials. Come back to your project and go to APIs and services > Credentials and click on + Create credentials button on the top bar to create a new service account.

The service account will require a name to identify it, “Forms Bridge WP” for example. With this name the wizard will create the account ID as an email address, leave it with its default value and click on Create and continue and then on Done.

After that, you have to go to the new account details and copy its email address. With this email address on the clipboard, go to one of your spreadsheets, open the Share menu and invite this email address as an editor.

The last step is to generate a new private key for the service account. Go back to the service account details and under the tab Keys click on the Add key > Create new key button and select the JSON key type. The browser will start the download of a JSON file. Save it in a secure place! Now, go to the Forms Bridge settings page and upload this file into the Credentials panel of the Google Sheets addon.

To check the credentials, try to add a new Google Sheets Bridge. If the credentials are correctly set up, you will find your spreadsheet as an option of the spreadsheet selector of the bridge creation form.

Backend

The addon will automatically register its own backend on activation. The backend will have “Sheets API” as name and https://sheets.googleapis.com/v4/spreadsheets as its URL value. The backend is configured out of the box, you don’t need to tweak.

The addon will re-register a new backend connection if it does not find the original setting values. If you try to modify the backend you will end up with duplicated backend registrations.

Bridges

The addon works with a custom bridge that does not requires a backend reference (it is linked with the default backend connection under the hood). The required fields of a Google Sheets Bridge are:

  1. Name: The unique identifier of the bridge
  2. Form: A reference to an existing form
  3. Spreadsheet: A reference to an existing spreadsheet. Select it from the available options.
  4. Tab name: Name of the tab where you want Forms Bridge to write form submissions

Once you have your forms bridge to your spreadsheets, each form submission will be wrote as a line on the selected tab.

The addon will create a new tab if it does not exists.

The first row of the tab is treated as the column names of the table.
This columns should match the bridge payload schema to allow Forms Bridge to map submission values to columns. If a field does not have a column with the same name, the field will be ignored on the synchronization.

Templates

The addon comes packed with the following template:

  • Contacts 🔎
    Simple contact form connected to a spreadsheet

  • WC Orders 🔎
    Sale order bridge template. The resulting bridge will convert WooCommerce orders into new lines on a Google Spreadsheet with order and customer information.

Supported integrations

Contact Form 7
WP Forms
Gravity Forms
Ninja Forms