Handle Multiple Google Form Submissions in One Spreadsheet with a Single Apps Script Trigger

When working with Google Forms + Google Sheets, a common setup is to connect several forms to the same spreadsheet. Each form creates its own response sheet automatically.

This works well at first. But as soon as you want to automate workflows with Google Apps Script, things become messy.

Typical situations:

  • You have multiple forms for different processes (client onboarding, support requests, event registrations, etc.)
  • Each form writes responses into a different sheet of the same spreadsheet
  • You want to trigger different automation logic depending on the form

The issue is that the Form Submit trigger in Google Sheets does not allow you to specify a different function depending on which form submitted the response.

The approach I use is to create one global trigger function that runs whenever a form submission occurs. This function then routes the event to the appropriate handler, based on the sheet that received the response.

A Single Dispatcher Trigger

The e object returned by the trigger provides the context of the event. From it, we can retrieve the range that triggered the execution, then access the sheet, and finally obtain the sheet name using function chaining.

const sheetName = e.range.getSheet().getName();

From there, we can decide which process should handle the submission.

Here is an example which can be easily

function Main_FormDispatcher(e) {

  // Get sheet name to retrieve what form was submitted
  const sheetName = e.range.getSheet().getName();

  Logger.log(`Form response received from sheet: ${sheetName}`);

  // Dispatch event
  if (sheetName === "Client Intake Responses") {
    processClientIntake(e);
  } else if (sheetName === "Bug Report Responses") {
    processBugReport(e);
  } else if (sheetName === "Newsletter Signup Responses") {
    processNewsletterSignup(e);
  } else {
    Logger.log(`Unknown form sheet detected: ${sheetName}`);
  }
}

If you regularly build Google Workspace automations, structuring your scripts around dispatcher functions like this one will save you a lot of time and complexity later.

Leave a Reply