Docs / Google Sheets
Send form submissions to Google Sheets
Every time someone submits your Webflow form, FormFlow adds one row to your Google Sheet. A short Google Apps Script in your own spreadsheet receives the submission, so you never sign in to Google inside FormFlow and you do not need Zapier or Make.
Setup takes about five minutes. You only do it once per spreadsheet.
On this page
Before you start
- A Google account and a Google Sheet that should collect the submissions (a new, empty sheet is fine).
- A form set up with FormFlow in the Webflow Designer. New to FormFlow? Start with Getting started.
- Google Sheets works on every plan on your
webflow.iostaging domain. On a custom domain, integrations need an active paid plan.
1. Open Apps Script
Open your Google Sheet and click Extensions → Apps Script. A new tab opens with an empty project that belongs to this spreadsheet.

2. Paste the script
Delete the sample code (function myFunction() { }), paste the FormFlow script below and press ⌘ S / Ctrl S to save. The same script is also behind the Copy scriptbutton in FormFlow's Webhook node.
/**
* FormFlow -> Google Sheets
* Adds one row to this spreadsheet for every FormFlow submission.
*
* Google asks for access to THIS spreadsheet only (not all of your Sheets) because of the next line.
* @OnlyCurrentDoc
*
* Setup: Extensions > Apps Script > paste this file > Save > Deploy > New deployment >
* type "Web app", Execute as "Me", Who has access "Anyone" > Deploy > copy the Web app URL
* (https://script.google.com/macros/s/.../exec) into the FormFlow Webhook node.
*
* Columns are created from the field names on the first submission; new fields get new columns.
*/
var SHEET_NAME = ''; // optional: name of the tab to write to (empty = first tab)
var META_COLUMNS = ['Submitted at', 'Form name', 'Submission ID'];
var PARTIAL_COLUMN = 'Partial lead';
var DUPLICATE_WINDOW = 200; // rows checked for the same Submission ID (a retried delivery adds no second row)
function doPost(e) {
var lock = LockService.getScriptLock();
lock.waitLock(8000); // below FormFlow's 10 s webhook timeout
try {
var payload = JSON.parse((e && e.postData && e.postData.contents) || '{}');
var book = SpreadsheetApp.getActiveSpreadsheet();
var sheet = SHEET_NAME ? (book.getSheetByName(SHEET_NAME) || book.insertSheet(SHEET_NAME)) : book.getSheets()[0];
var lastColumn = sheet.getLastColumn();
var headers = lastColumn > 0 ? sheet.getRange(1, 1, 1, lastColumn).getValues()[0] : [];
if (formflowSeen(sheet, headers, payload)) return formflowJson({ ok: true, duplicate: true });
var built = formflowRow(headers, payload);
if (built.headers.length > headers.length || lastColumn === 0) {
sheet.getRange(1, 1, 1, built.headers.length).setValues([built.headers]);
}
sheet.appendRow(built.row);
return formflowJson({ ok: true, columns: built.headers.length });
} catch (err) {
return formflowJson({ ok: false, error: String((err && err.message) || err).slice(0, 200) });
} finally {
lock.releaseLock();
}
}
/** Whether the last DUPLICATE_WINDOW rows already hold this payload's Submission ID (FormFlow retried after a timeout). */
function formflowSeen(sheet, headers, payload) {
var id = payload && payload.submissionId ? String(formflowCell(payload.submissionId)) : '';
if (!id || payload.partial === true) return false;
var col = -1;
for (var i = 0; i < headers.length; i++) if (formflowHeader(headers[i]) === META_COLUMNS[2]) col = i + 1;
var lastRow = sheet.getLastRow();
if (col < 1 || lastRow < 2) return false;
var count = Math.min(DUPLICATE_WINDOW, lastRow - 1);
var cells = sheet.getRange(lastRow - count + 1, col, count, 1).getValues();
for (var r = 0; r < cells.length; r++) {
var seen = String(cells[r][0]);
if (seen === id || "'" + seen === id) return true; // Sheets drops the text-marking apostrophe on read
}
return false;
}
function doGet() {
return formflowJson({ ok: true, message: 'FormFlow Google Sheets endpoint is ready. FormFlow sends submissions with POST.' });
}
/** Headers (existing ones kept in place, new keys appended) and the row values for one payload. */
function formflowRow(existingHeaders, payload) {
payload = payload && typeof payload === 'object' ? payload : {};
var data = payload.data && typeof payload.data === 'object' ? payload.data : {};
var values = {};
var order = [];
function put(key, value) {
if (!Object.prototype.hasOwnProperty.call(values, key)) order.push(key);
values[key] = value;
}
put(META_COLUMNS[0], payload.submittedAt || new Date().toISOString());
put(META_COLUMNS[1], payload.formName || '');
put(META_COLUMNS[2], payload.submissionId || '');
if (payload.partial === true) put(PARTIAL_COLUMN, 'yes');
Object.keys(data).forEach(function (key) {
var name = String(key).trim() || '(no name)';
if (META_COLUMNS.indexOf(name) !== -1 || name === PARTIAL_COLUMN) name = name + ' (field)';
put(formflowHeader(name), data[key]);
});
// Existing headers are compared in the same escaped form: Sheets returns '=x as =x when read back.
var headers = [];
for (var i = 0; i < existingHeaders.length; i++) headers.push(formflowHeader(existingHeaders[i]));
order.forEach(function (key) {
if (headers.indexOf(key) === -1) headers.push(key);
});
var row = headers.map(function (h) {
return Object.prototype.hasOwnProperty.call(values, h) ? formflowCell(values[h]) : '';
});
return { headers: headers, row: row };
}
/** One cell: arrays joined with ", ", objects as JSON, text that Sheets would run as a formula kept as text. */
function formflowCell(value) {
if (value === null || value === undefined) return '';
if (typeof value === 'number' || typeof value === 'boolean') return value;
var text = Array.isArray(value) ? value.join(', ') : typeof value === 'object' ? JSON.stringify(value) : String(value);
if (/^[=+\-@\t\r]/.test(text)) text = "'" + text;
return text.slice(0, 50000);
}
/** A column name (a field key from the site): never written as a formula, same form when read back. */
function formflowHeader(name) {
var text = String(name === null || name === undefined ? '' : name);
if (/^[=+\-@\t\r]/.test(text)) text = "'" + text;
return text.slice(0, 500);
}
function formflowJson(body) {
return ContentService.createTextOutput(JSON.stringify(body)).setMimeType(ContentService.MimeType.JSON);
}

Want the rows on a specific tab? Put the tab name between the quotes on the line var SHEET_NAME = '';. Empty means the first tab.
3. Deploy as a web app
- Click Deploy → New deployment.
- Click the gear icon next to Select type and choose Web app.
- Keep Execute as: Me.
- Change Who has access to Anyone. FormFlow's server sends the submissions and is not signed in to Google, so the other options would block it.
- Click Deploy.

"Anyone" means anyone who has the long, random web app URL can add a row. Keep the URL private, like a password: only paste it into FormFlow.
4. Allow access
The first time, Google asks you to authorize your own script. Click Authorize access, choose your account and click Continue (or Allow).
- Google lists one permission: View and manage spreadsheets that this application has been installed in. The
@OnlyCurrentDocline in the script limits it to this spreadsheet, not all of your Sheets. - With a personal Gmail account Google may first say Google hasn't verified this app. That is normal for a script you wrote or pasted yourself: click Advanced, then Go to … (unsafe).
- Copy the Web app URL that appears at the end. It looks like
https://script.google.com/macros/s/…/exec.
5. Connect FormFlow
- In the Webflow Designer, open FormFlow and select your form.
- Add a Webhook node and connect it after the last step.
- Paste the Web app URL into Webhook endpoint URL.
- Tick the box that confirms you own the URL.
- Optional: under Field Mapping, rename fields to the column names you want.
- Click Sync Webflow, then publish your site.

6. Send a test
Open your published site and submit the form. Within a few seconds a new row appears. The first submission also writes the column names into row 1.

How the columns work
- Every row starts with Submitted at, Form name and Submission ID, followed by your field names (or the names from Field Mapping).
- A new field gets a new column at the end. Existing columns keep their place, so you can rename the tab, add formulas in other columns or hide columns.
- Checkboxes with several answers are joined with commas, for example
A, B. - Repeatable groups add one column per entry:
Guest name,Guest name 2,Guest name 3… - With Partial Leads turned on, a visitor who clicks Next but may not finish gets a row with a Partial lead column set to
yes. If they submit later, the full submission adds its own row. - If FormFlow sends the same submission twice (for example an automatic retry after a timeout), the script sees the same Submission ID and does not add a second row.
- Answers that start with
=,+,-or@are saved as text, so a visitor cannot run a formula in your sheet.
Do not rename or delete the cells in row 1 while submissions are coming in: the script matches columns by those names. A renamed header is treated as a new field and gets a new column.
Change the script later
After editing the script, publish a new version under the same URL: Deploy → Manage deployments, click the pencil icon, choose Version: New version and click Deploy. A New deployment would give you a different URL that you would have to paste into FormFlow again.
To stop sending submissions, remove the URL from the Webhook node and sync, or archive the deployment under Deploy → Manage deployments.
Privacy and security
- FormFlow never asks for your Google password or a Google login. The script runs in your own Google account and writes only to this spreadsheet.
- FormFlow forwards each submission from its server to your web app URL over HTTPS after Webflow has received it, so your Webflow form data always keeps its own copy.
- The FormFlow delivery log keeps only the status of each delivery, never the answers. See Delivery log and retries.
Troubleshooting
- No rows appear: check that Who has access is Anyone and that the URL ends in
/exec(a URL ending in/devonly works while you are signed in). Then click Sync Webflow and publish the site again. - "Anyone" is not in the list: your Google Workspace administrator has turned it off. Ask them to allow web apps for anyone, or use a spreadsheet in an account that allows it.
- FormFlow shows the delivery as sent but the row is missing: open Apps Script and click Executions in the left menu. A failed run shows the error, for example a tab name in
SHEET_NAMEthat does not exist. - You changed the script but nothing changed: publish a new version of the same deployment (see Change the script later).
- Columns are in an odd order: drag the columns where you want them. The script finds each column by its name in row 1.
Still stuck? Email support@formflowapp.com or use the contact form.