Extending Google Forms with Add-ons

Google Forms is a cloud-based questionnaire and survey solution with real-time collaboration and powerful tools to customize form questions. Google Forms can also be used to create online quizzes.

You can extend Google Forms with add-ons that help users construct new surveys, establish connectivity to third-party systems, and integrate your Forms data with other G Suite applications (like Google Sheets).

What you can do

Here are a few things you can do with an add-on that extends Google Forms:

  • You can create, access, and edit Google Forms using the built-in Apps Script Forms service. The Spreadsheet service lets you access the Google Sheets where form responses are stored.
  • You can control form behavior from an add-on using the Forms service. For example, you can determine whether the form is accepting responses or sends a confirmation message to respondents.
  • You can create custom menus and define multiple custom dialog and sidebar interfaces using standard HTML and CSS. These UI components extend the Google Forms editor, not the form that respondents see.
  • You can use Add-ons triggers to run specified functions when certain triggering events occur. For example, form-submit installable triggers let your add-on react whenever someone submits a form response.

Form structure

A Google form is composed of a title, description, and a list of form questions. Optionally, a Form can have an associated Google Sheet where the form responses are collected.

Each form question has type indicating the kind of information it is asking the respondent for, or a static form element (like an image or video):

  • Question types
    • Short answer text
    • Paragraph text
    • Multiple choice
    • Checkboxes
    • Dropdown select menus
    • File upload
    • Linear scale
    • Multiple choice grid
    • Checkbox grid
    • Date
    • Duration
    • Date-time
  • Static types
    • Image
    • Page break
    • Section header
    • Video

Each type is represented by an object in the Apps Script Forms service. Forms add-ons can use this service to add, modify, rearrange, or remove form elements.

Quizzes

Forms can also act as quizzes. If you set designate a form as a quiz, you are able to assign point values and feedback to each form question. Point values enable customized grading of the quiz. Feedback, represented by the QuizFeedback class in the Forms service, is text and links that are presented to the respondent after answering the associated form question.

Triggers

Apps Script triggers let a script project execute a specified function when certain conditions are met, such as when a form is submitted or when an add-on is installed.

See Add-on triggers for more information on what triggers can be used with Forms add-ons and what restrictions apply to their use.