Book a session

Introducing a Game-Changing Solution: Creating a Google Form from a Google Spreadsheet

google form google sheet script technology Jun 21, 2023
Converting Google Sheets into Google Forms

- An article by Shashiprabha Jinathissa

Have you ever found yourself in a situation where you had a complex set of data on a Google Sheet and wished there was a way to convert it into a Google Form effortlessly? Well, I've been there too, and I'm excited to share my experience with you.

Imagine having a treasure trove of information meticulously arranged on a Google Sheet, and the task at hand is to transform that data into a form. The thought of manually copying and pasting all the questions and answers can be a daunting and time-consuming endeavor. This is the exact situation I found myself in, prompting me to seek a solution that could automate the process and help me reclaim precious time

Naturally, I turned to the internet, hoping to find a comprehensive solution. I watched countless tutorial videos, read numerous blog posts, and even dug deep into the first three pages of my Google search results. But to my surprise, I couldn't find a clear and straightforward answer. Most of the resources I stumbled upon only provided instructions on linking a sheet to a form, suggested outdated plugins, or gave incomplete guidance with buggy codes.

After struggling for almost two and a half hours, I realized the solution I sought wasn't readily available online. But instead of giving up, I had an Eureka moment. Why not take matters into my own hands and figure out how to do it myself?

Armed with determination, I embarked on a journey of trial and error. And after some diligent coding and testing, I successfully developed a solution that allowed me to create a Google Form from my Google Sheet seamlessly. Allow me to share the code with you so that if you ever find yourself in the same situation, you are not struggling as I did!

The script below automates the process of converting a spreadsheet into a Google Form:

function createFormFromSheet() {
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  var form = FormApp.create("Your Form Title"); // Replace with your desired form title

  var lastRow = sheet.getLastRow();
  var questionsRange = sheet.getRange("A1:F" + lastRow); // Replace with your data range
  var questionsData = questionsRange.getValues();

  for (var i = 0; i < questionsData.length; i++) {
    var question = questionsData[i][0];
    var questionType = questionsData[i][1];
    var answerOptions = questionsData[i].slice(2); // Get the answer options in the spreadsheet starting from column C

    var formItem;
    if (questionType === "Multiple Choice") {
      formItem = form.addMultipleChoiceItem();
      formItem.setChoices(answerOptions.filter(function (option) {
        return option !== ""; // Exclude empty answer options
      }).map(function (option) {
        return formItem.createChoice(option);
    } else if (questionType === "Checkbox") {
      formItem = form.addCheckboxItem();
      formItem.setChoices(answerOptions.filter(function (option) {
        return option !== ""; // Exclude empty answer options
      }).map(function (option) {
        return formItem.createChoice(option);
    } else if (questionType === "Date") {
      formItem = form.addDateItem();
    } else if (questionType === "Time") {
      formItem = form.addTimeItem();
    } else if (questionType === "Short Text") {
      formItem = form.addTextItem();
    } else if (questionType === "Paragraph") {
      formItem = form.addParagraphTextItem();
    } else if (questionType === "Dropdown") {
      formItem = form.addListItem();
      formItem.setChoiceValues(answerOptions.filter(function (option) {
        return option !== ""; // Exclude empty answer options
    } else {
      // Unsupported question types, handle or skip as needed


  var formUrl = form.getPublishedUrl();
  Logger.log("Form created: " + formUrl);

With this script, you can easily generate a Google Form based on the questions and answer options you have specified in your spreadsheet.

Now, let's go through the steps to make it work:


Step 1: Open your Google Spreadsheet

Navigate to your Google Drive and locate the spreadsheet where your data is stored. If you haven't created one yet, no worries! Just click the "+ New" button, select "Google Sheets," and create a fresh spreadsheet. Or else use the template that you can find at and change the questions and answers to match your needs.


Step 2: Access the Script Editor

Within your Google Spreadsheet, look for the "Extensions" tab in the top menu. Click on it and select "Apps Script" from the dropdown menu. This action will open the Apps Script editor in a new tab.


Step 3: Write or Paste the Script

In the Apps Script editor, you'll find a blank canvas where you can write your script. Don't worry if you're new to scripting; I've got you covered. You can either write the script from scratch using the provided code or copy and paste the script I shared above. This script will seamlessly convert your spreadsheet into a Google Form if you are using the Google Sheet template from this link.

Remember to replace "Form Title" with the desired title for your form. Additionally, adjust the data range in the questionsRange variable to match the range of your questions and answer options on the spreadsheet.

If your Sheet has a different structure than the template I used, you may have to change your code a bit until it matched the structure of your data set.


Step 4: Save the Script

After writing or pasting the script, and making necessary adjustments, it's time to save it. Click on the floppy disk icon (or go to "File" in the top menu and select "Save"). Give your script a meaningful name, such as "Form Generator Script," that reflects its purpose.



Step 5: Run the Script

To generate your Google Form from the spreadsheet, it's time to run the script. Click on the play button ▶️ in the toolbar (or go to "Run" in the top menu and select "Run Function").

You may have to allow some permissions in order to run the script. Review and allow permissions as required so that the script will do its thing.

Sit back and relax as the magic happens! Your form will be created based on the questions and answer options you specified in the spreadsheet.


Step 6: Access and Customize Your Form

Congratulations! Your Google Form is now ready for action. To access it, simply click on the form's title, which will appear as a link in the "Execution log" window.

You also can copy the given address and paste that in a new tab on your browser to view the created form.

Take a moment to explore your form and customize it further to meet your specific requirements. You can adjust the form's layout, add images or videos, and even set up conditional logic to show or hide certain questions based on previous answers. To do that, you can go to your Google drive and locate the newly created form.



By following these simple steps and using the script provided, you can effortlessly transform a Google Spreadsheet into a dynamic Google Form. It's time to unlock the true power of digital data collection!

Overwhelmed by the idea of modifying code? Don't fret! I understand your frustration and I'm here to help without adding any further confusion. As I have already mentioned above, I've got a solution that requires no code editing. I've uploaded a handy Google Sheet template that you can download and use for your own projects. This meticulously crafted template serves as a starting point, saving you time and effort. No need to spend hours creating a spreadsheet from scratch or worrying about missing important data. The best part is, the template seamlessly integrates with the script we discussed earlier. Even if you're not familiar with coding or hesitant to make changes, you can still make the most of the template hassle-free. It empowers you to focus on extracting insights from your data without getting caught up in technicalities.

To download the template and kickstart your form creation, visit It provides a well-structured framework tailored to your industry, giving you a solid foundation. Say goodbye to starting from scratch and confidently transform your spreadsheet into a user-friendly form.

I understand that navigating the intricacies of data research and coding can be challenging. That's why I'm here to offer my assistance and expertise. If you have any questions, encounter any roadblocks, or need further instructions on utilizing the template or the script, don't hesitate to reach out. Simply leave a comment on this article or get in touch with me directly, and I'll be more than happy to guide you through the process.

Remember, converting a Google Sheet into a Google Form doesn't have to be a daunting task. With the right tools and a little guidance, you can simplify the process and unlock new possibilities for your data-driven endeavors. So go ahead, try it out, and let the power of automation revolutionize the way you create forms from your existing spreadsheet data. Happy form building!