title: Google Apps Scripts no longer runs getActiveUser() within Sheets custom button triggers
body: <p>The following functions used to work but no longer work unless the scripts are ran inside the console. <code>Session.getActiveUser()</code> would usually run inside Google Sheets scripts assigned to an inserted drawing or a time based trigger. When the scripts are ran, <code>Session.getActiveUser()</code> only runs if I (the spreadsheet owner) run the scrip. If it's someone else, it either doesn't work or <code>Session.getActiveUser().getEmail()</code> outputs a blank string. To be clear, all scripts are ran within a spreadsheet environment. NOT a deployed web app.</p>
  <pre><code>function printEmail() 
  {
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var s = ss.getSheetByName(&quot;Test Stuff&quot;);
  
    var outputCell = ss.getRangeByName(&quot;testOutput&quot;);
  
    Logger.log(Session.getActiveUser().getEmail());
  
    outputCell.setValue( Session.getActiveUser().getEmail());
  }
  
  function printAdminEmail()
  {
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var s = ss.getSheetByName(&quot;Test Stuff&quot;);
  
    var outputCell = ss.getRangeByName(&quot;testOutput&quot;);
  
    outputCell.setValue( Session.getEffectiveUser().getEmail());
  }
  </code></pre>
  <p>Here is a screenshot of attempting to run the script from a spreadsheet drawing. Returns blank. Drawing assigned to &quot;printEmail&quot;</p>
  <p><a href="https://i.stack.imgur.com/iMhD9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iMhD9.png" alt="enter image description here" /></a></p>
  <p>Here is the JSON Manifest.</p>
  <pre><code>{
    &quot;timeZone&quot;: &quot;America/New_York&quot;,
    &quot;dependencies&quot;: {
      &quot;enabledAdvancedServices&quot;: [
        {
          &quot;userSymbol&quot;: &quot;Sheets&quot;,
          &quot;version&quot;: &quot;v4&quot;,
          &quot;serviceId&quot;: &quot;sheets&quot;
        },
        {
          &quot;userSymbol&quot;: &quot;DocsList&quot;,
          &quot;version&quot;: &quot;v1&quot;,
          &quot;serviceId&quot;: &quot;docs&quot;
        },
        {
          &quot;userSymbol&quot;: &quot;Calendar&quot;,
          &quot;version&quot;: &quot;v3&quot;,
          &quot;serviceId&quot;: &quot;calendar&quot;
        },
        {
          &quot;userSymbol&quot;: &quot;People&quot;,
          &quot;version&quot;: &quot;v1&quot;,
          &quot;serviceId&quot;: &quot;peopleapi&quot;
        },
        {
          &quot;userSymbol&quot;: &quot;Tasks&quot;,
          &quot;version&quot;: &quot;v1&quot;,
          &quot;serviceId&quot;: &quot;tasks&quot;
        }
      ]
    },
    &quot;oauthScopes&quot;: [
      &quot;https://www.googleapis.com/auth/spreadsheets.readonly&quot;,
      &quot;https://www.googleapis.com/auth/userinfo.email&quot;,
      &quot;https://www.googleapis.com/auth/contacts.readonly&quot;,
      &quot;https://www.googleapis.com/auth/spreadsheets.currentonly&quot;,
      &quot;https://www.google.com/m8/feeds&quot;,
      &quot;https://www.googleapis.com/auth/drive.readonly&quot;,
      &quot;https://www.googleapis.com/auth/drive&quot;,
      &quot;https://www.googleapis.com/auth/calendar&quot;,
      &quot;https://www.googleapis.com/auth/calendar.readonly&quot;,
      &quot;https://www.google.com/calendar/feeds&quot;,
      &quot;https://www.googleapis.com/auth/documents&quot;,
      &quot;https://www.googleapis.com/auth/spreadsheets&quot;,
      &quot;https://www.googleapis.com/auth/gmail.send&quot;,
      &quot;https://www.googleapis.com/auth/gmail.compose&quot;,
      &quot;https://www.googleapis.com/auth/gmail.modify&quot;,
      &quot;https://mail.google.com/&quot;,
      &quot;https://www.googleapis.com/auth/gmail.addons.current.action.compose&quot;,
      &quot;https://www.googleapis.com/auth/tasks&quot;
    ],
    &quot;exceptionLogging&quot;: &quot;STACKDRIVER&quot;,
    &quot;runtimeVersion&quot;: &quot;V8&quot;,
    &quot;sheets&quot;: {
      &quot;macros&quot;: [
        {
          &quot;menuName&quot;: &quot;sortCaseload&quot;,
          &quot;functionName&quot;: &quot;sortCaseload&quot;
        },
        {
          &quot;menuName&quot;: &quot;df&quot;,
          &quot;functionName&quot;: &quot;df&quot;
        }
      ]
    },
    &quot;webapp&quot;: {
      &quot;executeAs&quot;: &quot;USER_ACCESSING&quot;,
      &quot;access&quot;: &quot;DOMAIN&quot;
    }
  }
  </code></pre>