Skip to content

This JavaScript script automates the process of populating a Google Form from data stored in a Google Sheet, making it ideal for conducting surveys or creating artificial intelligence-driven surveys.

Notifications You must be signed in to change notification settings

sai8151/sheets-to-forms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

The importCSVDataToForm function is a Google Apps Script function designed to import data from a CSV file into a Google Form programmatically. It automates the process of populating form responses from a spreadsheet containing CSV data.

How It Works

The function reads data from a CSV file, assumes the first row contains column headings, matches the column headings to the form items, and creates form responses accordingly. It supports various item types such as text, multiple choice, etc.

Usefull for MBA students to fill the form

Usage

  1. Ensure you have a Google Form created and obtain its ID.
  2. Open the Google Apps Script editor for your Google Sheets document.
  3. Copy and paste the importCSVDataToForm function into the script editor.
  4. Replace 'GOOGLE_FORM_ID' with the ID of your Google Form.
  5. Run the function importCSVDataToForm.

Supported Item Types

The function currently supports the following item types:

  • Text
  • Multiple Choice

Handling Empty Cells

The function handles empty cells in the CSV data by skipping them and logging a message to the console.

Error Handling

Errors that occur during form submission are caught and logged to the console.

Limitations

  • Currently, only text and multiple-choice item types are supported. Additional item types can be added as needed.
  • The function assumes that the CSV data matches the form structure. Any mismatch may lead to unexpected behavior.

About

This JavaScript script automates the process of populating a Google Form from data stored in a Google Sheet, making it ideal for conducting surveys or creating artificial intelligence-driven surveys.

Topics

Resources

Stars

Watchers

Forks