Use Google Script to populate a short text item responseHow can I remove the first line of a text file using bash/sed script?Stopping scripters from slamming your websitePopulate a Google Form responses from a Google SpreadsheetCan a Google Form be auto filled and submitted, using data from a spreadsheet?onOpen trigger not being activated on Google FormGoogle Form, make answer field readonlyGoogle Forms using Apps Script to generate responses with personalized headers?How to pre-fill multiple fields in Google forms via a spreadsheet hyperlink code?Possible to populate a Google Form's Questions with a Spreadsheet / CSV?Using a user selected choice from a drop-down to populate a text field in Google Forms

What is the highest achievable score in Catan

Was the Psych theme song written for the show?

Patio gate not at right angle to the house

What force enables us to walk? Friction or normal reaction?

Can machine learning learn a function like finding maximum from a list?

Why did some Apollo missions carry a grenade launcher?

Can a US President, after impeachment and removal, be re-elected or re-appointed?

Just how much information should you share with a former client?

How close to the Sun would you have to be to hear it?

Why are we moving in circles with a tandem kayak?

When encrypting twice with two separate keys, can a single key decrypt both steps?

How can Paypal know my card is being used in another account?

Should I put my name first, or last in the team members list

A basic question on circuits and matrix representation

Solve equation using Mathematica

On the sensitivity conjecture?

Using Python in a Bash Script

How do I make my photos have more impact?

Does Ubuntu reduce battery life?

Is it okay for me to decline a project on ethical grounds?

May a hotel provide accommodation for fewer people than booked?

Why would anyone ever invest in a cash-only etf?

How would a lunar colony attack Earth?

What are the closest international airports in different countries?



Use Google Script to populate a short text item response


How can I remove the first line of a text file using bash/sed script?Stopping scripters from slamming your websitePopulate a Google Form responses from a Google SpreadsheetCan a Google Form be auto filled and submitted, using data from a spreadsheet?onOpen trigger not being activated on Google FormGoogle Form, make answer field readonlyGoogle Forms using Apps Script to generate responses with personalized headers?How to pre-fill multiple fields in Google forms via a spreadsheet hyperlink code?Possible to populate a Google Form's Questions with a Spreadsheet / CSV?Using a user selected choice from a drop-down to populate a text field in Google Forms






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I'm trying to pre-populate a short-answer-text field on my Google Form. The id of the field is '1542424645'.



This is the script I'm starting with:




function onOpen(e) 

// Generate Form Number then add to Form Description
var str1 = Math.round(Math.random()*10000) + '0000';
var str2 = Math.round(Math.random()*10000) + '0000';
var formNumber01 = str1.slice(0,4);
var formNumber02 = str2.slice(0,4);
var formNumber = 'Unique Form # ' + formNumber01 + "-" + formNumber02;

// Identify active form
var form = FormApp.getActiveForm();

// Add Form Number to Form Description
form.setDescription(formNumber);

// entry.1542424645()





I'm able to populate the form description but that information doesn't transfer to a spreadsheet. What I need to do is populate the "Form Number" short-answer-text field (ID='1542424645') with this information.



I DON'T WANT TO USE A SPREADSHEET OR PRE-FILLED URL! I simply need a code snippet in the onOpen() function above to fill in the info. Given the usage of the form, and what its designed to do this is the only option I'm able to use.



Thanks for any help you can provide.










share|improve this question
































    0















    I'm trying to pre-populate a short-answer-text field on my Google Form. The id of the field is '1542424645'.



    This is the script I'm starting with:




    function onOpen(e) 

    // Generate Form Number then add to Form Description
    var str1 = Math.round(Math.random()*10000) + '0000';
    var str2 = Math.round(Math.random()*10000) + '0000';
    var formNumber01 = str1.slice(0,4);
    var formNumber02 = str2.slice(0,4);
    var formNumber = 'Unique Form # ' + formNumber01 + "-" + formNumber02;

    // Identify active form
    var form = FormApp.getActiveForm();

    // Add Form Number to Form Description
    form.setDescription(formNumber);

    // entry.1542424645()





    I'm able to populate the form description but that information doesn't transfer to a spreadsheet. What I need to do is populate the "Form Number" short-answer-text field (ID='1542424645') with this information.



    I DON'T WANT TO USE A SPREADSHEET OR PRE-FILLED URL! I simply need a code snippet in the onOpen() function above to fill in the info. Given the usage of the form, and what its designed to do this is the only option I'm able to use.



    Thanks for any help you can provide.










    share|improve this question




























      0












      0








      0








      I'm trying to pre-populate a short-answer-text field on my Google Form. The id of the field is '1542424645'.



      This is the script I'm starting with:




      function onOpen(e) 

      // Generate Form Number then add to Form Description
      var str1 = Math.round(Math.random()*10000) + '0000';
      var str2 = Math.round(Math.random()*10000) + '0000';
      var formNumber01 = str1.slice(0,4);
      var formNumber02 = str2.slice(0,4);
      var formNumber = 'Unique Form # ' + formNumber01 + "-" + formNumber02;

      // Identify active form
      var form = FormApp.getActiveForm();

      // Add Form Number to Form Description
      form.setDescription(formNumber);

      // entry.1542424645()





      I'm able to populate the form description but that information doesn't transfer to a spreadsheet. What I need to do is populate the "Form Number" short-answer-text field (ID='1542424645') with this information.



      I DON'T WANT TO USE A SPREADSHEET OR PRE-FILLED URL! I simply need a code snippet in the onOpen() function above to fill in the info. Given the usage of the form, and what its designed to do this is the only option I'm able to use.



      Thanks for any help you can provide.










      share|improve this question
















      I'm trying to pre-populate a short-answer-text field on my Google Form. The id of the field is '1542424645'.



      This is the script I'm starting with:




      function onOpen(e) 

      // Generate Form Number then add to Form Description
      var str1 = Math.round(Math.random()*10000) + '0000';
      var str2 = Math.round(Math.random()*10000) + '0000';
      var formNumber01 = str1.slice(0,4);
      var formNumber02 = str2.slice(0,4);
      var formNumber = 'Unique Form # ' + formNumber01 + "-" + formNumber02;

      // Identify active form
      var form = FormApp.getActiveForm();

      // Add Form Number to Form Description
      form.setDescription(formNumber);

      // entry.1542424645()





      I'm able to populate the form description but that information doesn't transfer to a spreadsheet. What I need to do is populate the "Form Number" short-answer-text field (ID='1542424645') with this information.



      I DON'T WANT TO USE A SPREADSHEET OR PRE-FILLED URL! I simply need a code snippet in the onOpen() function above to fill in the info. Given the usage of the form, and what its designed to do this is the only option I'm able to use.



      Thanks for any help you can provide.







      scripting google-form form-fields






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 26 at 23:24









      mackycheese21

      7081 gold badge4 silver badges18 bronze badges




      7081 gold badge4 silver badges18 bronze badges










      asked Mar 26 at 21:17









      ThomasThomas

      12 bronze badges




      12 bronze badges

























          0






          active

          oldest

          votes










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55366325%2fuse-google-script-to-populate-a-short-text-item-response%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes




          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55366325%2fuse-google-script-to-populate-a-short-text-item-response%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript