I'm trying to have an "Updated by" cell for each row edited on a Google Sheet. Supposedly, I can do
SpreadsheetApp.getActiveSpreadsheet().getName("Sheet 1").getRange(r.getRow(), 16).setValue(Session.getActiveUser());
However, while it works on my account, it doesn't on my staff account (login through Cloud Identity). Then I found "If security policies do not allow access to the user's identity, User.getEmail() returns a blank string." on https://developers.google.com/apps-script/reference/base/session#getActiveUser().
Now, I'm the admin for the GSuite Business account, but I don't find such policy setting in admin.google.com nor in their user profile. Any clue as to how I can grab the User Identity on GSheet?
Also, at the moment,
.getActiveUser() returns an email address. Any way I can make it returns the User Name for better legibility?