title: Rename existing google drive folder names
body: <p>I have over 100+ google drive folders I would like to update the name using GAS. I use this code below but when I tested it, the folder name changes to "undefined". Is .setName() correct method to use or do I need to copy the folder and rename it to accomplish this?</p>
  
  <ul>
  <li>FolderID is listed in Column A</li>
  <li>FolderName (new foldername) is listed in Column B</li>
  <li><p>Updated? is in Column C to denote if row has completed.</p>
  
  <pre><code>function renameFolderName(){
      var s = SpreadsheetApp.openById("sheetIDhere").getSheetByName('TEST');
      var id = s.getRange(2,1,s.getLastRow()).getValues();
      var foldernames = s.getRange(2,2,s.getLastRow()).getValues();
      var updated = "Yes";
  
  for (a = 0; a &lt; id.length-1; a++){
       for (b = 0; b &lt; foldernames.length-1; b++)
           {
       var folderlocation = DriveApp.getFolderById(id[a][0]).setName(foldernames[b][1]);
       s.getRange(a+2,3).setValue(updated);
           }
           }
           }
  </code></pre></li>
  </ul>
  
  <p>The current test changes the folder name to "undefined" but actural result should be whatever the value that is listed in column B.</p>