← All AI articles

Create a survey with AI and Google Forms in 3 minutes

Draft questions and branches, then generate a Google Form.

This article was written in German by Christian Rothe and translated into English with the help of AI. Read the German original.

Google Apps Script can create questions, sections and branching in Google Forms. Describe the survey’s goal to your AI tool and generate the script instead of adding every question manually.

For a survey about AI use, create two routes: users answer questions about tools and experience; non-users explain their reasons. Both routes reach a shared closing section. You can then edit the generated form in Google Forms.

How to proceed

  1. Fill in your topic, audience and research question. Ask the AI to generate a Google Apps Script for the form.
  2. Open script.google.com, create a project and paste the code. Run createSurvey and confirm Google access.
  3. Open the form link from the execution log. Test both answer branches in preview before sharing.

Start with a defined research question. Test the branches for AI users and non-users.

Prompt

Create a complete Google Apps Script that builds a Google Forms survey.
Topic: [topic]
Audience: [audience]
Research question: [question]

Function: createSurvey(). Use FormApp and log editing and participant URLs with Logger.log.

Structure:
1. Shared background questions.
2. Multiple-choice question: Do you use generative AI? Yes / No.
3. Yes branch: frequency, tools, uses and experience.
4. No branch: reasons and expectations.
5. Shared closing section.

Route the Yes/No choices with MultipleChoiceItem.createChoice(answer, targetSection). Use PageBreakItem.setGoToPage for section destinations. Use neutral, independently analysable questions. Do not invent mandatory personal-data fields. Output all executable code and the three steps needed to run it.
Open Google Apps ScriptOpen Google FormsFormApp documentation