class Session method .getEffectiveUser()

Session is the Apps Script service.

.getEffectiveUser() is the method name you will see after a dot in your code.

What it does

Returns the email of the user whose permissions the script is using.

Why it's used

  • See whose permissions apply when a trigger runs as owner.
  • Debug auth issues on shared spreadsheets.

Common errors

  • Forgetting parentheses on getEffectiveUser. Write Session.getEffectiveUser(), not Session.getEffectiveUser or getEffectiveUser by itself.
  • Skipping dots between chained calls. Each step needs a dot, like Session.getEffectiveUser().
  • Adding spaces where they do not belong. Write Session.getEffectiveUser(), not Session .getEffectiveUser(), Session.getEffectiveUser (), or Session . getEffectiveUser().
  • Wrong capitalization. Use Session and getEffectiveUser, not session or geteffectiveuser.

Explore

Related methods

Better Sheets tutorials

No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.

Related blog posts

Written guides about Session.getEffectiveUser().

Browse the blog