title: Google App script trigger does not work on simple custom function
body: <p>I am very new to google app script while having some experience both in javascript and python.</p>
  <p>I am trying to run a very simple script <a href="https://docs.google.com/spreadsheets/d/1MSmpHKcMbZVjU0cd1-te78kEmZs_EeqcIQlXgj-bDIg/edit?usp=sharing" rel="nofollow noreferrer">in this custom spreadsheet</a>, see row 1.</p>
  <p>I am using the custom function feature, no apps/services deployed and I have full read/write authorizations.</p>
  <p>I am developing some time conversion and duration calculation functions for a personal project, while trying to experiment with triggers starting with very simple functions.</p>
  <p>The code associated with the trigger is indeed very simple: check the value of a predefined cell (&quot;A1&quot; in this case) and return its value in the cell where the function is invoked. As simple as possible, just to experiment with app script triggers:</p>
  <pre><code>function zain(){ 
    var sheet = SpreadsheetApp.getActiveSheet(); 
    var a = sheet.getRange(&quot;A1&quot;).getValue();  
   return a;}
  </code></pre>
  <p>To the effect of updating the cell value whenever any cell in the sheet is changed, I installed an onEdit() trigger on the function &quot;zain()&quot;.</p>
  <p>Now, the problem is: it does not work. The trigger log shows that onEdit() is successfully being completed, but the value in the cell where the function is invoked does not change, at all. It only seems to work whenever I re-paste the function or change the code and save it. Otherwise nothing.</p>
  <p>I looked through all possible issues related to triggers in this forum and, contrarily to other cases, I could not find any working solution. I checked issues with trigger objects, spreadsheet access, but none of these solutions seems to be working/apply to my case.</p>
  <p>If someone could be so kind to help in this matter, it would be greatly appreciated.</p>