title: How to find and select table from Document in Apps Script?
body: <p>I'm creating a function in Google Apps Script. The purpose of this function is selecting the table from the document and move values to the created Spreadsheet. The problem is that I can't get the table from the document (debugging is OK, but logs show selected table as empty <code>{}</code>).</p>
  
  <pre><code>    function addAnswersTable() {
      var File = function(Path) { // File object constructor
          this.Path = Path;
          this.Doc = DocumentApp.openById(this.Path);
          this.getTable = new function()
          // This function defines 
          // a getTable method to get 
          // the first table in the Document
          {
              if (this.Doc != undefined) {
                  var range = this.Doc.getBody();
                  var tables = range.getTables();
                  var table = tables[0];
                  return table;
              }
          }
      }
      // Creating Excel Table, where first column
      // of selected table should be moved
      var Table = SpreadsheetApp.create("AnswersTable");
      // Creating new File object
      var TrueAnswersFile = new File
      ('1_ne9iBaK-Z36yUYrISr3gru3zw3Qdsneiu14sWnjn34');
      // Calling getTable method to get the table placed in File 
      var TrueAnswersTable = TrueAnswersFile.getTable;
      for (var i = 1; i &lt;= TrueAnswersTable.getNumRows; i++) {
          // Filling spreadsheet "A" column with cells'
          // values ​​from table stored in File
          Table.getActiveSheet().getRange("A" + i).setValue(TrueAnswersTable.getCell(1, i).getValue());
      };
      }
  </code></pre>
  
  <p>I except the output in Spreadsheet column "A" like :</p>
  
  <p>A1. Just<br>
  A2. Cells'<br>
  A3. List item with<br>
  A4. Values From Table</p>
  
  <p>Actually spreadsheet is empty</p>