title: Dynamically update Google Form 'Choose from list' options from column in Spreadsheet
body: <p>I am trying to setup a Google Form that will create a '<strong>choose from list</strong>' question, with each option being drawn from the rows in a specific column.</p>
  
  <p>I have tried <a href="https://webapps.stackexchange.com/questions/40292/is-there-a-way-to-link-a-choose-from-a-list-style-question-in-a-google-form-to">this code</a>, but it has not worked for me at all.</p>
  
  <p>The code that I have so far is below. I am able to create the desired form question with the data from only one row in the specific column (in this case the last row of the column).</p>
  
  <p>If anyone can help by pointing me the right direction as to how to assign each selected row to only one questions option.
  Also if these is some kind of way to dynamically update the question options every time the spreadsheet is updated.</p>
  
  <pre><code>var idColumn = 1; // ID of the selected column
  
  //gets document ID from spreadsheet 
  //(not 100% sure the role of all of these lines, have worked it out from other examples of code online)
  function spreadSheetGetter() {
    var sheet = SpreadsheetApp.getActiveSheet();
    var rows = sheet.getDataRange();
    var numRows = rows.getNumRows();
    var values = rows.getValues();
    var lr = rows.getLastRow();  
  
    var docId = sheet.getRange(lr,idColumn,1,1).getValue(); //gets the data from the last row in selected column
  
  fillFormData(docId);
  }
  
  
  //fills for with document ID
  function fillFormData(docId) {
  var form = FormApp.openById('MY FORMS ID');
  var item = form.addListItem();
  
  item.setTitle('Select Existing Customer') //creates the choose from list question
       .setChoices([
           item.createChoice(docId), //data from row 1
           item.createChoice(docId) //data from row 2 etc...
         ])
  }
  </code></pre>