Google Script How do I getGivenName() of getActiveUser()

前端 未结 5 2092
刺人心
刺人心 2021-01-03 02:42

Each user on the domain initiates a simple script we run for leave entitlements but we want the welcome message to be \"Hi First Name,\" however the script doesn\'t seem to

5条回答
  •  孤城傲影
    2021-01-03 03:05

    In Apps Script, I was able to get this information using the About REST API: https://developers.google.com/drive/v2/reference/about/get

    var aboutData = Drive.About.get();
    var userEmail = aboutData["user"]["emailAddress"];
    var userDisplayName = aboutData["user"]["displayName"];
    

提交回复
热议问题