Google script : cannot access e.user on edit change -


the following algorithm:

  • make form
  • in script editor, create script function:

    function displayuser(e){   logger.log(e.user);   logger.log(e.user.getemail()); } 
  • create trigger runs displayuser after event from spreadsheet on edit.

  • edit spreadsheet of form

the logging output displays:

undefined

the execution transcript says:

execution failed: typeerror: cannot call method "getemail" of undefined. (line 3, file "code")

however, google documentation specifies e.user:

always returns user object, representing owner of spreadsheet

it's not case here e.user undefined.

i used command before new access right management system of google, , worked fine - returned information owner of spreadsheet.

did make mistake?

you're right, doesn't return owner of ss. when renamed onedit() , working simple trigger return effective user of sheet guess that's not need ;-) - never used before cannot confirm worked before if you're sure check issue tracker (i did , didn't find mention of it) , create new one.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -