Google Contacts Address is not retrieved by my Script (although it is filled) -



Google Contacts Address is not retrieved by my Script (although it is filled) -

i seek fetch content of google contacts via google apps script. first identified id of contact via getid function. script this:

var id = 'id'; var contact = contactsapp.getcontactbyid(id); var address = contact.getaddresses(); gmailapp.sendemail("email", address, "");

the homecoming via mail service "addressfield", allthough contact has address.

in add-on tried next script official reference (which returns same thing):

// logs address 'home address' field contact 'john doe'. // can used other fields contain addresses. var contacts = contactsapp.getcontactsbyname('john doe'); var homeaddress = contacts[0].getaddresses(contactsapp.field.home_address); logger.log(homeaddress[0].getaddress());

can help me?

thanks lot in advance.

best, phil

this works me :

function testcontact(){ var contacts = contactsapp.getcontactsbyname('some name in contacts'); logger.log(contacts[0].getfamilyname());// check it's right 1 var address = contacts[0].getaddresses(); (var n=0;n<address.length;n++){ logger.log(address[n].getlabel()+' : '+address[n].getaddress());// address fields contact + corresponding label } }

google-apps-script google-contacts

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -