Google-sheets – How to get the name of a colleague from the Google Account email address within a Google Sheet

google sheetsgoogle-workspace

My company uses Google Workspace (G-Suite), and all users have a Google Account identified by their company email address.

I have a Google Form that writes to a Google Sheets spreadsheet. It automatically collects the account email address of the user who submits the form, but I'd like to get the name of the user, which appears in the G-suite directory.

Has anyone done this or could anyone help me figure out if it's possible? I can write a script if needed, but I have no special privileges within the G-suite service.

Best Answer

I may be wrong, but I believe the email is all you will get from the user inside Google Suite. Class User | Apps Script

You may have to then lookup the name, etc. inside your organization's directory (LDAP, AD, or similar). You'll have to ask someone in Identity Services within IT to see if that's allowed and how (API?) you can do that from Google Scripting.