I have a small google spreadsheets which multiple users are accessing and adding info in it. I've been trying to get the email of every user which edits a row but I can't seem to find out how it works! In here it's written that I can do it with getActiveUser() function but when changes are made, it just leaves a blank cell on the row!
Here is what I've done so far:
function onEdit(e) {
var s = SpreadsheetApp.getActiveSheet();
var email = Session.getActiveUser().getEmail();
if( s.getName() == "Sources with Bugs" ) {
var r = s.getActiveCell();
if( r.getColumn() == 2) {
var userCell = r.offset(0, 4);
userCell.setValue(email);
}
}
}
So as I said, basically if a user edits the 2nd column of any rows, the 6th column should be filled with the user's email! Anyone has any idea what am I doing wrong?