This Google Apps Script (createForm.gs
) automates the process of creating Google Forms based on the data provided in a Google Sheets document. It is designed to convert survey or quiz questions stored in a spreadsheet into a functional Google Form, streamlining the creation process.
- A Google account.
- Access to Google Sheets and Google Forms.
- Open Google Sheets and create a new document.
- In the first sheet, which will be used by the script, input your form questions and configurations according to the format below. Ensure this sheet is in the first position (farthest left tab).
Example table for Google Sheet:
Question Title | Question Type | Options |
---|---|---|
Section 1: Personal Information | SECTION | Please fill out the following personal details. |
What is your full name? | TEXT | |
Describe yourself | PARAGRAPH | |
What is your favorite color? | MULTIPLE_CHOICE | Red, Green, Blue, Yellow |
Section 2: Preferences | SECTION | Let us know about your preferences. |
Which fruits do you like? | CHECKBOX | Apple, Banana, Cherry, Date |
Choose your department | DROPDOWN | HR, Tech, Marketing, Sales |
Section 3: Feedback | SECTION | Please provide your feedback. |
Rate your satisfaction | SCALE | 10, Very Unsatisfied, Very Satisfied |
Select your birthdate | DATE | |
What time do you wake up? | TIME |
- Open Google Forms.
- Navigate to the 'Extensions' menu, then select 'Apps Script'.
- Clear any existing code in the script editor and paste the code from
createForm.gs
. - Save the script under a suitable name, e.g., "Create Form from Sheet".
- Execute the script by clicking on the play button in the toolbar of the Apps Script editor.
- If this is your first time running the script, Google will request authorization to access your Google account. Follow the prompts to allow the necessary permissions.
- When the script runs for the first time, it automatically creates a Google Form and links it to a new Form Responses sheet within your Google Sheets document.
- To run the script with a new set of questions, ensure the sheet with those questions is in the first position.
Ensure that:
- The questions sheet is in the first tab position.
- The first row of your sheet contains headers and is excluded from the form creation.
Contributions to improve the script are welcome! Please fork this repository and submit a pull request with your suggested changes.
For assistance, please raise an issue in the repository.
This project is licensed under the MIT License.