Send responses to Google Sheets

A one-time, three-minute setup. After this, every submission adds a row automatically.

  1. Open the Google Sheet where you want responses to land.
  2. 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);
}
  1. Click Deploy → New deployment and choose type Web app.
  2. Set Execute as: Me and Who has access: Anyone, then Deploy and authorise.
  3. Copy the Web app URL — it ends in /exec.
  4. 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.

Didn’t answer your question?

We reply to every message, usually within one working day.

Contact support