Integration Tutorial

How to Connect Google Sheets Forms to Form2Lead

Step-by-step developer instructions for Google Sheets applications.

Last updated:
Direct Answer

How do you send Google Sheets form submissions to Form2Lead?

Form2Lead connects directly to Google Sheets using a minimal Google Apps Script Web App and our Flat JSON preset. When a lead is submitted, Form2Lead follows Google’s HTTP 302 Found redirect safely with SSRF protection and appends a row instantly — 100% free with no Zapier or third-party middleware required.

Verified product capabilityRead documentation →

Why use Form2Lead with Google Sheets?

Google Sheets is the most popular destination for lead capture. While other form backends fail with Google Apps Script because they cannot safely follow Google’s 302 Found redirect to script.googleusercontent.com, Form2Lead includes built-in multi-hop redirect traversal with strict SSRF validation. Combined with our Flat JSON preset, every submission arrives with top-level fields ready to append into your sheet columns automatically.

Prerequisites

  • ✔A Google account with access to Google Sheets
  • ✔A Form2Lead form with webhooks enabled
  • ✔A free Google Apps Script Web App deployed in your spreadsheet

Step-by-Step Integration Guide

01. Open Apps Script in Google Sheets

Open your Google Sheet, click Extensions → Apps Script. This opens the built-in script editor.

02. Paste the Web App Handler

Replace any existing code with this 10-line handler. It parses the Flat JSON payload and appends new rows with automatic header creation:

function doPost(e) {
  try {
    var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
    var data = JSON.parse(e.postData.contents);
    // Auto-create header row if the sheet is empty
    if (sheet.getLastRow() === 0) {
      sheet.appendRow(Object.keys(data));
    }
    sheet.appendRow(Object.values(data));
    return ContentService.createTextOutput(JSON.stringify({ status: "success" }))
      .setMimeType(ContentService.MimeType.JSON);
  } catch (err) {
    return ContentService.createTextOutput(JSON.stringify({ error: err.toString() }))
      .setMimeType(ContentService.MimeType.JSON);
  }
}

03. Deploy as a Web App

Click Deploy → New deployment. Select Web app. Set "Execute as: Me" and "Who has access: Anyone". Click Deploy and copy the Web App URL.

04. Paste URL in Form2Lead & Auto-Detect

In your Form2Lead form Setup tab, paste the Web App URL. Form2Lead immediately auto-detects "Google Sheets & Flat JSON". Click Add Webhook and send a test lead.

Google Sheets Integration FAQ

Direct Answer

Do I need a paid Zapier plan to send form leads into Google Sheets?

No! The Google Apps Script path runs entirely inside your own Google account for free. Form2Lead formats payloads as Flat JSON and safely follows Google’s HTTP 302 redirect.

Direct Answer

Why do Google Apps Script webhooks fail in other form tools?

Google Apps Script responds with an HTTP 302 Found redirect to script.googleusercontent.com. Most form backends abort redirects or incorrectly block them as SSRF. Form2Lead validates each hop against private subnets while successfully delivering to Google’s public servers.

Direct Answer

Will spam submissions pollute my Google Sheet?

No. All spam is intercepted upstream by Form2Lead’s invisible honeypot and IP rate limiting. Flagged submissions are quarantined in your dashboard Spam tab and never trigger webhooks.