I was hoping you could help me,
I'm looking to display the current user of a google sheet in a cell to pull a vlookup off,
I have added a script to pull the logged in username into a script gallery but I am unable to dump the logger.log information into a google sheet
Any information would be great,
thank you Nigel
At the top of the Users list, click Download users. Choose to download a filtered list or a list of all users. Choose to include only the columns displayed in the Users list or all available columns in the downloaded file. Choose to download the users list as a CSV file or export it to Google Sheets.
This works fine :) remember how to use getRange(row,column) as it will be your best friend now you are scripting..
function setActiveUser() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
// 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);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With