Integration

TownHall + Google Sheets Integration

Automatically log all form submissions to Google Sheets. Create a live database of responses without any manual data entry.

Features

Automatic row creation for each submission
Column headers from form fields
Timestamp and metadata logging
Multiple sheets per form
Formulas work with live data
Share sheets with team

How to set up

1

Create a Google Sheet

Create a new Google Sheet where submissions will be logged.

2

Set Up Apps Script

Go to Extensions → Apps Script and paste our webhook handler code.

3

Deploy as Web App

Deploy the script as a web app and copy the deployment URL.

4

Add to TownHall

Paste the Google Apps Script URL as a webhook in TownHall.

Code example

JavaScript
// Google Apps Script for TownHall webhook
function doPost(e) {
  const sheet = SpreadsheetApp.getActiveSheet();
  const data = JSON.parse(e.postData.contents);
  
  // Get or create headers
  let headers = sheet.getRange(1, 1, 1, sheet.getLastColumn()).getValues()[0];
  if (headers[0] === '') {
    headers = ['Timestamp', 'ID', ...Object.keys(data.submission.data)];
    sheet.getRange(1, 1, 1, headers.length).setValues([headers]);
  }
  
  // Add new row
  const row = headers.map(h => {
    if (h === 'Timestamp') return new Date().toISOString();
    if (h === 'ID') return data.submission.id;
    return data.submission.data[h] || '';
  });
  
  sheet.appendRow(row);
  return ContentService.createTextOutput(JSON.stringify({success: true}));
}

Use cases

Lead tracking spreadsheets
Survey response analysis
Event registration lists
Support ticket logging
Team accessible databases

Related integrations

FAQ

Frequently asked questions

Common questions about integrating TownHall with Google Sheets.

How do I connect TownHall to Google Sheets?

Connecting TownHall to Google Sheets is straightforward. Create a new Google Sheet where submissions will be logged. The integration typically takes less than 10 minutes to set up.

Does the Google Sheets integration work on the free tier?

Yes! TownHall webhooks and integrations work on all plans, including the free tier. You can connect Google Sheets to your forms without upgrading to a paid plan.

What data is sent to Google Sheets?

TownHall sends all form submission data to Google Sheets, including all form fields, submission metadata (timestamp, IP address), and form information. You can customize the payload format if needed.

Can I use multiple integrations at once?

Absolutely! You can connect multiple integrations to a single form. For example, you can send submissions to both Google Sheets and Slack simultaneously. There's no limit on the number of integrations per form.

What happens if the Google Sheets integration fails?

TownHall automatically retries failed webhook deliveries up to 3 times with exponential backoff. If all retries fail, you'll receive an error notification, and the submission will still be stored in your TownHall dashboard.

Do I need coding knowledge to set up the Google Sheets integration?

Most integrations require minimal technical knowledge. Google Sheets integration typically involves copying a webhook URL and pasting it into your TownHall form settings. Our documentation provides step-by-step instructions.

Ship the feature, not the infrastructure.

Create a form, paste one endpoint into your markup, and take your first submission before your coffee goes cold. The backend is our problem now.