Hi all,
I’m trying to get the current app user within my google sheet, but I’m not being able to achieve it.
I’ve set a custom trigger in the google sheet (onchange) that fires the following script.
function myFunctionSetCurrentUser() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName('Hoja 1');
// GET EMAIL ADDRESS OF ACTIVE USER
var email = Session.getActiveUser().getEmail();
Logger.log(email);
//SET CELL A1 TO EMAIL ADDRESS OF ACTIVE USER
sheet.getRange(1,1).setValue(email);
}
This script gets the current user name and sets its value in A1, but I’ve found out that this user is not the app user but always the google sheet owner / app creator. Does anybody know how can I get the app signed in user?
Thanks for your time mates!