Send responses to Google Sheets
A one-time, three-minute setup. After this, every submission adds a row automatically.
- Open the Google Sheet where you want responses to land.
- Click Extensions → Apps Script. Delete anything in the editor and paste the snippet below.
function doPost(e) {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var data = JSON.parse(e.postData.contents);
var headers = sheet.getRange(1, 1, 1, Math.max(1, sheet.getLastColumn())).getValues()[0];
if (!headers[0]) { // first run: write a header row
headers = Object.keys(data);
sheet.appendRow(headers);
}
var row = headers.map(function (h) { return data[h] != null ? data[h] : ''; });
sheet.appendRow(row);
return ContentService
.createTextOutput(JSON.stringify({ ok: true }))
.setMimeType(ContentService.MimeType.JSON);
}- Click Deploy → New deployment and choose type Web app.
- Set Execute as: Me and Who has access: Anyone, then Deploy and authorise.
- Copy the Web app URL — it ends in /exec.
- In Formspry open your form → Automations → Google Sheets, paste the URL, and Save.
Note: The first submission writes a header row from your field labels; every response after that is appended below it.
More in Integrations & automations
Didn’t answer your question?
We reply to every message, usually within one working day.
Contact support