google-apps-script - 使用对象的值查询 AdminDirectory.Users.get
问题描述
我正在使用 Google Apps 脚本,到目前为止,我可以根据其电子邮件查询用户详细信息:
var result = AdminDirectory.Users.get('some.email@domain.com', {viewType:'domain_public'});
Logger.log(result.externalIds);
在这种情况下,结果仅限于对象“externalIds”并读取:
{customType=Auth ID, type=custom, value=abc123}
现在,有没有办法从电子邮件地址的响应和查询中获取值?就像是:
var result = AdminDirectory.Users.get({customType: 'Auth ID', type: 'custom', value: 'abc123'}, {viewType:'domain_public'});
Logger.log(result.emails);
得到类似的东西:
{address=some.email@domain.com, primary=true}
而且,我可以只从 emails 对象中获取值“地址”吗?
谢谢大家。
编辑:刚刚发现我可以通过以下方式获取特定的字段地址:
Logger.log(result.emails[0].address);
解决方案
推荐阅读
- ruby - Ruby Selenium ActionBuilder send_keys 方法复制我发送的字符串
- gradle - Gradle 的 processResources 扩展 '\n'
- android - 即使选择了“调试”构建变体,“adbd 无法在生产构建中以 root 身份运行”?
- google-cloud-firestore - 如何保持大量的唯一计数?
- javascript - RxJS debounceTime(0) still postpones execution
- javascript - Vue.js 跟踪.js
- ssis - SSIS模糊查找未加载表以匹配
- bash - Bash: loop ffmpeg command through sets of subfolders and direct it to files in the folders for processing
- docker - How to create top-level named volume with a relative path for the source?
- machine-learning - 这是否可以在没有数据的情况下基于旧网络训练新网络?