Get user id of whom run a script

Here is how to get user id of whom run a script.

Source Code

function myFunction(){
  var userId = Session.getActiveUser().getUserLoginId();
  Browser.msgBox(userId);
}

Format

Session.getActiveUser().getUserLoginId()

Return

User object

Note

If the email of whom run a script is different from the owner’s email, a script cannot be run.

How to get user’s email address?

Please refer the following post.

How to get Email address of whom run a script?

Leave a Comment