title: Import list of contact groups in GAS
body: <p>I can't find anything related in Stack Overflow on this.</p>
  
  <p>I'm trying to post a list of my google contact group names and id's into F16:G.</p>
  
  <p>The code I'm using keeps saying: "Cannot convert Array to Object[][]. (line 39, file "email")"</p>
  
  <p>Please help! I'm not good at arrays! An explanation of what I'm doing wrong would be awesome as well!</p>
  
  <pre><code>function importContactGroups() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
     var dataSheet = ss.getSheetByName("Load Email");
     var dataRow = dataSheet.getRange("F16:F");
  
     var groupArray = new Array();
  
  
  
  //var groups = Browser.inputBox("Enter the name of your Gmail Contacts group here:");
  
   //var mySheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); 
  
  
  
    //var myContacts = ContactsApp.findContactGroup(groupName).getContacts();
  
  
    var groups  = ContactsApp.getContactGroups();
   for (var i = 0; i &lt; groups.length; i++) {
  
     var groupNames = groupArray.push(groups[i].getName());
  
   };
  
  dataSheet.getRange(16, 4, groupArray.length, 5).setValues(groupArray);
  
  
   // for (i=0; i &lt; myContacts.length; i++) {
     // var myContact = [[myContacts[i].getFullName(), myContacts[i].getPrimaryEmail(), "Pending"]];
      //mySheet.getRange(i+2, 1,1,3).setValues(myContact);
    //}
    //Browser.msgBox("You have successfully imported " + myContacts.length + " contacts from Gmail. Please proceed to Step 3.");
   }
  </code></pre>