Form to Google Sheets: get your answers into a spreadsheet

Updated 2026-10-30

There is no built-in Google Sheets sync yet. I import a CSV, or I run a short Apps Script. A native sync is on the roadmap, with no date.

Option 1: import a CSV

  1. Get the CSV. Use the CSV button on the form page. Or run this:

    bash
    curl -sS "https://aiformapi.com/v1/forms/FORM_ID/responses?format=csv" \
      -H "Authorization: Bearer $AIFORMAPI_KEY" \
      -o responses.csv
  2. In Google Sheets, choose File, Import. Pick the .csv file.

  3. Pick an import option, such as Append rows to current sheet. Set the separator to Comma. Click Import.

For new rows later, pull with since. Without it, I add old rows again.

bash
curl -sS "https://aiformapi.com/v1/forms/FORM_ID/responses?format=csv&since=2026-10-30T00:00:00Z" \
  -H "Authorization: Bearer $AIFORMAPI_KEY" \
  -o new-rows.csv

Append repeats the header row. Delete it once. More: form to CSV.

Option 2: an Apps Script

An example script, not an official add-on. It replaces the sheet named Responses on each run. Keep your own data elsewhere.

Set it up.

  1. Open the Apps Script editor from your spreadsheet. Paste the script below.
  2. Click Project Settings. Under Script Properties, add AIFORMAPI_KEY with your key and AIFORMAPI_FORM_ID with your form id. Save.
  3. Run importResponses once. Approve the permissions.
javascript
// Example script, not an official add-on. Adjust it for your sheet.
const SHEET_NAME = "Responses";

function importResponses() {
  const props = PropertiesService.getScriptProperties();
  const key = props.getProperty("AIFORMAPI_KEY");
  const formId = props.getProperty("AIFORMAPI_FORM_ID");
  if (!key || !formId) {
    throw new Error("Set AIFORMAPI_KEY and AIFORMAPI_FORM_ID in Script Properties.");
  }

  const url = "https://aiformapi.com/v1/forms/" + formId + "/responses?format=csv";
  const res = UrlFetchApp.fetch(url, {
    headers: { Authorization: "Bearer " + key },
    muteHttpExceptions: true,
  });
  if (res.getResponseCode() !== 200) {
    throw new Error("AI Form API said " + res.getResponseCode() + ": " + res.getContentText());
  }

  // Answers come from the public. A leading space stops text from being read as a formula.
  const safe = (cell) => (/^[=+\-@]/.test(cell) ? " " + cell : cell);
  const rows = Utilities.parseCsv(res.getContentText()).map((row) => row.map(safe));
  if (rows.length === 0) return;

  const ss = SpreadsheetApp.getActiveSpreadsheet();
  const sheet = ss.getSheetByName(SHEET_NAME) || ss.insertSheet(SHEET_NAME);
  sheet.clearContents();
  sheet.getRange(1, 1, rows.length, rows[0].length).setValues(rows);
}

Run it on a schedule. Click Triggers, then Add Trigger. Choose importResponses and a time-driven schedule. Each run is one request. An hourly trigger uses 24 a day. See rate limits.

Guard the key. Anyone who can edit the script can read it. Rotate the key in the dashboard settings if you need to.

Large forms. One CSV holds up to 10,000 rows. For more, page the JSON with cursor. See the responses guide.

A webhook can also call your code per response. We ship no Sheets connector.

IMPORTDATA fails

IMPORTDATA(url) sends only a URL, not the Authorization header. You get 401 unauthorized. Never put your key in a link. Use the script above.

Careful with strangers' answers

A cell can start with =, +, - or @. Our CSV puts an apostrophe in front, so it stays text. The script adds a leading space too.

Next

Start with the quickstart. Coming from Google Forms? See the alternative.

Sources, read 2026-10-30: CSV import, IMPORTDATA, parseCsv, UrlFetchApp, properties guide, properties service, triggers.

Questions

Does AI Form API sync responses to Google Sheets?

Not yet. Today you import a CSV, or run a short Apps Script that fetches it with your API key. A native sync is on the roadmap, with no date.

How do I import a CSV into Google Sheets?

In Sheets choose File, Import and pick the .csv file. Choose an import option. Set the separator to Comma or Detect automatically. Click Import.

Can the IMPORTDATA function read my responses?

No. IMPORTDATA sends only a URL, and the API needs your key in a header. Use the Apps Script on this page. It sends the header for you.