Reputation: 21
Problem: I can't get the name from the specified contact when I add my Directory contacts into "My Contacts". There are some strange solutions I've found:
SIDE NOTE: I can successfully get the emails fine using this method. It's just information like the name that is a problem
var svContacts = ContactsApp.getContacts();
for (var i=0; i<svContacts.length; i++) {
var nameStr = svContacts[i].getFullName();
Logger.log(nameStr);
}
Upvotes: 0
Views: 706
Reputation: 7858
I can't be 100% sure, but I suspect strongly that adding a contact from the shared directory to your own contacts doesn't really copy it over until you do something that edits the contact (like sending them an email or adding them to a group). Apps Script sees the same contacts that are exposed in the Google Contacts GData API, but it does not currently have the ability to see directory contacts, so this would explain your results.
Upvotes: 1