雖然現在一切都在運行,但我只看到記錄的 [Contact],因為它回傳一個陣列。ContactsApp.getContacts ByEmailAdress('[email protected]')但是,除了 之外,沒有關于如何獲取電子郵件的檔案。
感謝您的澄清。
安東尼奧
uj5u.com熱心網友回復:
當getContactsByEmailAddress(query)看到of的官方檔案時,回傳值為Contact[]。不幸的是,雖然我看不到您用于檢索 的實際腳本[Contact],但我猜您可能會看到帶有Logger.log. 如果我的理解正確,請在日志中Logger.log(ContactsApp.getContactsByEmailAddress("### email address ###"))顯示[Contact]。
我認為這可能是Why ContactsApp.getContacts ByEmailAdress('[email protected]') returns [Contact] using Google Apps Script?.
如果您想從聯系人中檢索其他資料,以下示例腳本如何?
示例腳本:
const res = ContactsApp.getContactsByEmailAddress("### email address ###");
// Logger.log(res) // In this case, `[Contact]` and `[Contact, Contact,,,]` can be seen.
const name = res.map(e => e.getFullName());
Logger.log(name) // In this case, as a sample, the full name is retrieved from the retrieved contact object.
參考:
- getContactsByEmailAddress(查詢)
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/360223.html
