Skip to main content
Send form submissions directly to a Google Sheets spreadsheet.

Setup Steps

1

Create a Google Sheet

  1. Go to Google Sheets
  2. Create a new spreadsheet
  3. Add column headers in the first row matching your form fields
  4. Example: Name, Email, Message, Submitted At
2

Create a Google Apps Script

  1. In your spreadsheet, go to ExtensionsApps Script
  2. Delete any existing code
  3. Paste the following script:
function doPost(e) {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  const data = JSON.parse(e.postData.contents);
  
  // Get headers from first row
  const headers = sheet.getRange(1, 1, 1, sheet.getLastColumn()).getValues()[0];
  
  // Create row based on headers
  const row = headers.map(header => {
    const key = header.toLowerCase().replace(/\s+/g, '_');
    return data[key] || data[header] || '';
  });
  
  // Add timestamp if column exists
  const timestampIndex = headers.findIndex(h => 
    h.toLowerCase().includes('submitted') || h.toLowerCase().includes('timestamp')
  );
  if (timestampIndex !== -1) {
    row[timestampIndex] = new Date().toISOString();
  }
  
  sheet.appendRow(row);
  
  return ContentService.createTextOutput(JSON.stringify({success: true}))
    .setMimeType(ContentService.MimeType.JSON);
}
3

Deploy the Script

  1. Click DeployNew deployment
  2. Click the gear icon → Web app
  3. Set Execute as: “Me”
  4. Set Who has access: “Anyone”
  5. Click Deploy
  6. Authorize the app when prompted
  7. Copy the Web app URL
4

Configure in Spike

  1. Go to your Spike Dashboard
  2. Select your form → Settings
  3. Scroll to IntegrationsGoogle Sheets
  4. Enable the toggle
  5. Paste your Apps Script Web app URL
  6. Save changes

Column Mapping

The script automatically maps form fields to columns:
Form FieldColumn Header
nameName
emailEmail
messageMessage
Any fieldMatching header
Column headers are case-insensitive and spaces are converted to underscores for matching.

Adding a Timestamp

Add a column called “Submitted At” or “Timestamp” to automatically record when each submission was received.

Troubleshooting

  • Verify the Apps Script URL is correct
  • Check that the script is deployed as a web app
  • Ensure “Anyone” has access to the web app
  • Check the Apps Script execution logs for errors
  • Column headers must match form field names
  • Headers are case-insensitive
  • Spaces in headers are matched to underscores in field names
  • Re-deploy the script and re-authorize
  • Make sure you’re using the correct Google account

Advanced: Custom Field Mapping

Modify the Apps Script to customize how fields are mapped:
function doPost(e) {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  const data = JSON.parse(e.postData.contents);
  
  // Custom mapping
  const row = [
    data.name || '',
    data.email || '',
    data.phone || '',
    data.message || '',
    new Date().toISOString()
  ];
  
  sheet.appendRow(row);
  
  return ContentService.createTextOutput(JSON.stringify({success: true}))
    .setMimeType(ContentService.MimeType.JSON);
}