简体   繁体   English

点击按钮的 Google Scripts 用户 ID

[英]Google Scripts user ID who clicks on button

I have created a button on the google sheet, I am sharing the sheet with multiple users.我在 google 工作表上创建了一个按钮,我正在与多个用户共享工作表。 Is there any way to get the id of the specific user who has clicked the button??有什么方法可以获取单击按钮的特定用户的 id 吗?

You might want to use Class Session wherein you can use the getActiveUser() method.您可能希望使用可以使用getActiveUser()方法的类会话

With this method, you can get information about the current user.使用此方法,您可以获得有关当前用户的信息。 If security policies do not allow access to the user's identity, User.getEmail() returns a blank string.如果安全策略不允许访问用户的身份, User.getEmail()返回一个空白字符串。

Hope that helps!希望有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM