title: Writing the result of getEditors and getViewers to Google Sheets
body: <p>I want to write some metadata from Drive files in a spreadsheet. I get the owner, name, Id, url, etc., but I'm having problems with the <code>File#getEditors()</code> and <code>File#getViewers()</code> methods.  </p>
  
  <p>I get this value written in the cells where the editors and viewers results are written:</p>
  
  <blockquote>
    <p>[Ljava.lang.Object@....</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/UF23z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UF23z.png" alt="enter image description here"></a>
  Anyone knows what is happening? I'm the owner of the files.</p>
  
  <p>My script:</p>
  
  <pre><code>function getChildFolders(parentName, parent, data, sheet, listAll) {
    sheet.appendRow(["Full Path", "Name", "Type", "URL", "Access", "Permission", "Editors can share", "Owner", "Can edit", "Can comment", "Can view"]);
  
    var childFolders = parent.getFolders();
    var childFiles = parent.getFiles();
  
    while (childFiles.hasNext()) {
      var fileItem = childFiles.next();
  
      data = [
        parentName + "/" + fileItem.getName() + "/" + fileItem.getName(),
        fileItem.getName(),
        fileItem.getMimeType(),
        fileItem.getUrl(),
        fileItem.getAccess(Session.getActiveUser()),
        fileItem.getSharingPermission(),
        fileItem.isShareableByEditors(),
        fileItem.getOwner().getEmail(),
        fileItem.getEditors(),
        fileItem.getViewers()
      ];
  
      // Write      
      sheet.appendRow(data);
  }
  </code></pre>