title: Interactive Google Spreadsheet to Google Doc edit not working
body: <p>I have several projects and they respect the same structure they have a table of 8 rows and two columns and I wrote so far a script that takes all the docs and then puts them in a table with the information as column.It is a container bound script and I want to be used by several users.I am blocked for a quite long time because I want to make interactivity if I modify in the table it will modify in the Google Doc and vice-verso.I begin I tried with the column date if I modify the date and then click on the url of the Google Doc to see the change but it doesn't work.This is my code : </p>
  
  <p><strong><em>Edit this is my new modified code:</em></strong> </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function modify_Date_Google_Spreadsheet_to_Google_Doc_Project(e) {
    
    find_columns_in_projet();
    Logger.log("&gt;&gt; The column URL &gt;&gt; " + COLUMN_URL );
    Logger.log("The column date where we will modify it " +  column_date_project);
    
    var tss = SpreadsheetApp.openById(SPREADSHEET_ID);
    var sheet = tss.getSheets()[0];
    var numRows = sheet.getLastRow();
    var lastColumn = sheet.getLastColumn();
    
    //from the second line car the first line we have the headers
    var data = sheet.getRange(1,1,numRows,lastColumn).getDisplayValues();
    
    if ( ( e.range.getColumnIndex() == column_date_project )  )
    {
      var activeRow = SpreadsheetApp.getActiveRange().getRowIndex();
      var URL = e.range.offset(0,1,1,1).getValue();
      Logger.log('The URL is : ' + URL );
      var body = DocumentApp.openByUrl(URL).getBody();
      Logger.log('The body is ' + body );
      if(body)
      {
        var ok = 0;                                    //for the moment we don't have the table to modify the values we've put in the spreadsheet 
        var numChildren=body.getNumChildren();
        var compteur=0;
        //while we don't find the table we will search
        while(ok ==0 &amp;&amp; compteur&lt;numChildren)
        {
          var child=body.getChild(compteur);
          /** =========We are concerned by the first table with at least 8 rows ===**/
          Logger.log('the type in the loop  ' + child.getType());
          
          //here is our table  **/
          if(child.getType()==DocumentApp.ElementType.TABLE &amp;&amp; child.asTable().getNumRows() &gt;= 8)
          {
            //so the variable gets 1 &gt;&gt;  ok = 1
            ok=1;   
            
            /**  The number of rows in the Google Doc table **/
            var numrows = child.asTable().getNumRows();
            Logger.log('The number of rows is   ' + numrows);
            //Logger.log('The new date is ' + data[activeRow][colonne_date_de_projet-1]);
            /** we will loop in the table **/ 
            
            var k = 1;     //we know the information is at right so we don't loop we will replace the value 
            /**  is not working   **********************************************/
            //child.asTable().getCell(7, k).editAsText().setText( data[activeRow][column_date_project-1] )  ;
           
            
            /**** is working   ***/
            child.asTable().getCell(7, k).editAsText().setText( 10 )  ;
          }
          compteur++;       /** until we find our table **/
        }
      }
    }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>It's a trigger on edit because I have another one in the project This is the Google Spreadsheed with the script inside : <a href="https://docs.google.com/spreadsheets/d/1k_kj98U__0Bk44gh0qRFpaVx0ru3sN1pSPGiMQwimxo/edit?usp=sharing" rel="nofollow noreferrer">https://docs.google.com/spreadsheets/d/1k_kj98U__0Bk44gh0qRFpaVx0ru3sN1pSPGiMQwimxo/edit?usp=sharing</a> and my folder with the Google Doc projects is here : <a href="https://drive.google.com/drive/folders/1x1m7tqfoSY6yW5gvwoIoh9jRPuiqwADO?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/drive/folders/1x1m7tqfoSY6yW5gvwoIoh9jRPuiqwADO?usp=sharing</a> Any idea is great :) thank you very much in advance <a href="https://i.stack.imgur.com/Ql6eD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ql6eD.png" alt="enter image description here"></a><a href="https://i.stack.imgur.com/kFZRa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kFZRa.png" alt="enter image description here"></a></p>