Webflow makes it easy to create powerful forms, but its built-in submission management can be limiting when handling and analyzing large amounts of data. Sending your Webflow form submissions to Google Sheets allows for easier collaboration, better filtering, and custom automation beyond Webflow’s built-in capabilities. This integration helps you keep all your form data organized in one place!
This guide will show you two simple ways to make this happen:
You might be wondering, “If Webflow already collects form submissions, why connect it to Google Sheets?” While Webflow does store your form responses, its built-in submission management is limited:
By integrating Webflow with Google Sheets, you get:
For teams looking for a quick, no-code solution, Zapier provides an excellent way to connect your Webflow forms with Google Sheets while maintaining complete design control.
What you'll need:
You’ve seen how quickly Zapier allows you to send Webflow form submissions directly to Google Sheets. For many businesses, especially those with moderate form volume, Zapier’s simplicity and free plan option make it an ideal choice.
If your form submissions are high-volume or you want to avoid recurring subscription costs, Method 2 offers a cost-effective alternative. This custom code approach directly connects Webflow with Google Sheets, making it ideal for scaling without relying on third-party tools.
In this method, we’ll set up a direct connection between your Webflow forms and Google Sheets using custom code. This involves adding a JavaScript snippet to your Webflow site and creating a Google Apps Script to process form submissions. Unlike third-party tools, this approach gives you full control over how your form data is handled and eliminates ongoing subscription costs.
This method automatically adds your Webflow form entries to a Google Sheet. The process uses a bit of pre-written code that handles the transfer behind the scenes. All you need to do is set things up correctly, and each new form submission will appear as a new row in your sheet.
What you'll need:
Before we set everything up, let’s go over a few key concepts to make sure the process is smooth and successful. Don’t worry—while some of these terms might be new, the ideas behind them are simple and easy to follow.
Google Apps Script is a built-in extension that allows Google Sheets to do things automatically. In this case, we will use Apps Script to automatically send form responses from Webflow into Google Sheets—so you don’t have to do it manually. Here is how it works:
Now that you understand the basics, let’s move on to making sure your form data flows correctly!
For your Webflow form submissions to be correctly stored in Google Sheets, the system needs to know exactly where each piece of data should go. To make this happen, the names of your form fields must be identical in these three places:
If the names don’t match exactly, Apps Script won’t recognize the data, and it won’t be saved correctly. Here is how to name fields correctly:
Correct setup:
Wrong setup:
Field naming rules:
Now that you understand how Webflow forms connect to Google Sheets, let’s go over how to organize multiple forms properly. There are different ways to organize your data, and while we suggest a structured approach, it’s completely flexible depending on your needs:
At the end of the day, the best approach depends on your specific needs. If you’re working, for example, with two different forms that collect different types of data, keeping them in separate tabs (or even separate Google Sheets) might make more sense.
Later in this guide, we’ll walk you through the step-by-step process of setting up multiple forms as part of the integration.
/**
* Webflow to Google Sheets Connector by BRIX Templates
*
* This script handles form submissions and sends them to specified tabs in your Google Sheet.
*/
/**
* Form configurations
* Add additional configurations following the same structure
* @version 1.0.3
* @author BRIX Templates
* @license MIT
*/
const FORMS = [
{
formToken: 'newsletterForm', // The token of your form in Webflow
sheetTabName: 'newsletterSubmissions', // The tab name in your Google Sheet
webflowFormFields: ['firstName', 'lastName', 'email'] // Form fields in order
},
// Example of adding another form:
/**
{
formToken: 'contactForm',
sheetTabName: 'contactForm',
webflowFormFields: ['firstName', 'lastName', 'email']
}
*/
];
/**
* Handles POST requests from Webflow forms
*/
function doPost(e) {
try {
if (!e || !e.parameter) {
throw new Error('No data received');
}
// Get the form identifier from the request
const formToken = e.parameter.formToken;
if (!formToken) {
throw new Error('Missing form token');
}
// Find the matching form configuration
const formConfig = FORMS.find(config => config.formToken === formToken);
if (!formConfig) {
throw new Error(`No configuration found for form: ${formToken}`);
}
// Get the specified sheet
const sheet = SpreadsheetApp.getActiveSpreadsheet()
.getSheetByName(formConfig.sheetTabName);
if (!sheet) {
throw new Error(`Sheet tab "${formConfig.sheetTabName}" not found`);
}
// Get form data from request
const data = e.parameter;
// Map form fields to columns in order
const row = formConfig.webflowFormFields.map(field => sanitizeInput(data[field]));
// Add the data as a new row
sheet.appendRow(row);
return createResponse('success', 'Form submission successful');
} catch (error) {
Logger.log(`Error: ${error.message}`);
return createResponse('error', error.message);
}
}
/**
* Creates a JSON response
*/
function createResponse(status, message = '') {
return ContentService.createTextOutput(
JSON.stringify({ result: status, message: message })
).setMimeType(ContentService.MimeType.JSON);
}
/**
* Sanitizes input data
*/
function sanitizeInput(input) {
if (typeof input !== 'string') return '';
return input.trim().replace(/"/g, '""');
}
In the script, you’ll find a section called const FORMS = []. This is where we define how each form connects to Google Sheets. Each form requires three pieces of information:
If you need to connect another form, simply copy and paste another {} object inside the FORMS array. Example of adding a job application form:
const FORMS = [
{
formToken: 'newsletterForm',
sheetTabName: 'newsletterSubmissions',
webflowFormFields: ['firstName', 'lastName', 'email']
},
{
formToken: 'contactForm',
sheetTabName: 'contactForm',
webflowFormFields: ['firstName', 'lastName', 'email', 'phoneNumber', 'message']
},
{
formToken: 'jobApplicationForm',
sheetTabName: 'jobApplications',
webflowFormFields: ['fullName', 'email', 'phoneNumber', 'resumeLink', 'linkedinLink']
}
];
Important:
<script>
/**
Webflow to Google Sheets Connector by BRIX Templates
Version 1.0
* Initializes form handlers for all forms with the brix-sheets-form attribute
*/
(function initializeFormHandlers() {
// Select all forms with the brix-sheets-form attribute
const forms = document.querySelectorAll('form[brix-sheets-form="enable"]');
if (forms.length === 0) {
console.warn('BRIX Templates: No forms found with brix-sheets-form="enable"');
return;
}
// Add submit handler to each form
forms.forEach(form => {
if (!form.getAttribute('brix-form-token')) {
console.warn('BRIX Templates: Form must have a brix-form-token attribute');
return;
}
form.addEventListener('submit', handleFormSubmit);
});
})();
/**
* Handles form submission
* @param {Event} event - Form submission event
*/
async function handleFormSubmit(event) {
event.preventDefault();
const form = event.target;
const formWrapper = form.closest('.w-form');
const successDiv = formWrapper.querySelector('.w-form-done');
const errorDiv = formWrapper.querySelector('.w-form-fail');
// Get the required attributes
const scriptUrl = form.getAttribute('brix-sheets-script-url');
const formToken = form.getAttribute('brix-form-token');
if (!scriptUrl || !formToken) {
console.error('BRIX Templates: Missing required attributes. Form needs both brix-sheets-script-url and brix-form-token.');
displayMessage(successDiv, false);
displayMessage(errorDiv, true);
return;
}
try {
// Collect form data
const formData = new FormData(form);
// Add the form token to the data
formData.append('formToken', formToken);
// Convert to URL-encoded string
const urlEncodedData = new URLSearchParams(formData).toString();
const response = await fetch(scriptUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: urlEncodedData
});
if (!response.ok) {
throw new Error('Network response was not OK');
}
const result = await response.json();
if (result.result === 'success') {
form.reset();
displayMessage(successDiv, true);
displayMessage(errorDiv, false);
} else {
throw new Error(result.message || 'Unknown error');
}
} catch (error) {
console.error('BRIX Templates: Submission error:', error);
displayMessage(successDiv, false);
displayMessage(errorDiv, true);
}
}
/**
* Displays or hides a message div
* @param {HTMLElement} messageDiv - Message element to toggle
* @param {boolean} show - Whether to show or hide the message
*/
function displayMessage(messageDiv, show) {
if (messageDiv) {
messageDiv.style.display = show ? 'block' : 'none';
}
}
</script>
And just like that, your Webflow form is now connected for direct data submission to your Google Sheet file. Before launching your form, take a moment to ensure everything works smoothly:
Submit test entries through your form Verify that:
Form submissions not appearing:
Wrong data placement:
For form submissions requiring advanced security measures, Cloudflare Workers can be configured as a proxy layer to protect your Google Apps Script URL and add customizable security features. By setting up Cloudflare Workers, you can enable additional layers of security, such as:
Setting up Cloudflare Workers does require some technical know-how. If you need help with advanced security configurations, feel free to reach out to our team—we’re here to provide personalized support and make the process easier for you!
By connecting your Webflow forms to Google Sheets, you've set up a powerful system that can handle all your form submission needs. This approach gives you the flexibility to manage your data effectively while keeping everything organized and easily accessible.
Remember to maintain consistent naming across your form fields and sheet columns, and periodically check your form submissions to ensure data is flowing correctly. As your website grows, this setup can easily accommodate new forms and fields by following the same structure we've covered.
Need help with more advanced connections between Webflow and Google Sheets, or looking to integrate other services with your Webflow site? Our team of Webflow experts is here to help – just reach out to us at BRIX Templates, and we'll help you create the perfect solution for your needs.
Discover how to save time by automating lead transfers from Webflow to Klaviyo.
Learn how to automatically truncate long text in Webflow by adding a single custom attribute. 5-minute setup, no coding experience needed
Step-by-step guide to bypass Webflow's 3-field checkout limit. Learn how to add unlimited custom fields to your Webflow Ecommerce checkout.