Send submissions to Google Sheets
Log form submissions in Google Sheets
Set it up
Most people finish this in a couple of minutes.
Open a blank spreadsheet and name it something like Form submissions. The first row is created for you on the first real submission.
Go to Extensions → Apps Script, replace the starter code with the script below, and save.
Click Deploy → New deployment. Choose Web app.
- Execute as: Me
- Who has access: Anyone
Deploy and copy the URL. It looks like https://script.google.com/macros/s/.../exec.
In your Boosterpack Forms dashboard, add that URL as a webhook. Submit the form once and watch a row appear.
Changed the script? Create a new deployment so the URL uses the new version. Email still arrives if you keep a destination inbox on the form.
The script
Headers are created on the first submission. After that, each send appends a row.
function doPost(e) {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var data = JSON.parse(e.postData.contents);
if (sheet.getLastRow() === 0) {
var headers = ['Timestamp', 'Form ID'];
var fieldNames = Object.keys(data.fields || {});
headers = headers.concat(fieldNames);
sheet.appendRow(headers);
}
var row = [
data.submittedAt || new Date().toISOString(),
data.formId || '',
];
var headers = sheet.getRange(1, 1, 1, sheet.getLastColumn()).getValues()[0];
for (var i = 2; i < headers.length; i++) {
var val = (data.fields && data.fields[headers[i]]) || '';
row.push(val);
}
sheet.appendRow(row);
return ContentService
.createTextOutput(JSON.stringify({ ok: true }))
.setMimeType(ContentService.MimeType.JSON);
}For developersYou can skip this.
You can skip this.
Apps Script cannot read our HMAC headers, so this path relies on the long, private web app URL. That is fine for most logs. If you need signed requests, put a small proxy in front.
curl -X PATCH "https://boosterpackforms.com/api/forms/<FORM_ID>" \
-H "Authorization: Bearer $BPF_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "addWebhookUrl": "https://script.google.com/macros/s/.../exec" }'Slack, Discord, and other destinations use webhooks, which are on Professional and Business. Email delivery works on every plan, including Free. You can keep email and add a destination later.
Send submissions somewhere else
Paste a webhook for Slack, Discord, Teams, Google Chat, or Telegram. Use Zapier, Make, or n8n for everything else.
Common questions
Can I send a contact form to Google Sheets without Zapier?
Is this free?
Will I still get email?
Webhooks are on Professional and Business. Email works on Free.