title: Create an in-cell drop-down (Google Sheet Data Validation) from a CSV list with Apps Script
body: <p>I have a spreadsheet that has multiple editors. I get a list of all users separated by comma using:</p>
  
  <pre><code>var users = ss.getEditors().toString();
  </code></pre>
  
  <p>Rather than having a list of users separated by comma, which looks ugly (I have 100+ users), I would like to set up a drop down menu to view users. To do that, I have written this:</p>
  
  <pre><code>function Dropdown() {
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var TestSheetName = "Test"
    var TestSheet = ss.getSheetByName(TestSheetName);
    var users = ss.getEditors().toString();
    TestSheet.getRange(1, 1).setDataValidation(SpreadsheetApp.newDataValidation()
      .setAllowInvalid(true)
      .requireValueInList([users], true)
      .build()
    );
  }
  </code></pre>
  
  <p>The drop down menu created shows the list with commas. What is bizarre is when I right click on the cell and go to "Data Validation," I can see that the users are put in correctly. When I then click 'OK' to close the menu, the dropdown corrects itself and I have the list of users correctly formatted.</p>
  
  <p>Am I doing something wrong with my code? Or is this a bug?</p>
  
  <p>Appreciate your insights.</p>