I'm using the GAS code bellow to add a new contact into Google Contacts (https://contacts.google.com/):
var contact = ContactsApp.createContact('Bbbb', 'Cccc', 'mymail@mails.com').addUrl(ContactsApp.Field.WORK_WEBSITE, 'https://sites.google.com/site/diccionarioie');
The code works perfectly but for a single detail: it adds the new contact to a hidden list and not to the main or visible «Contacts» list.
I know it works because when I use the lookup box to search for the newly created contact it's there, in the «Other contacts» list. I need it to be created in the main «Contacts» list from the beginning, otherwise I would have to do it manually using the «Add to contacts» icon with every contact created (I'm planning to add some thousands of contacts.)
Thanks.
Thanks a lot tehhwch.
I used your second code to get the right group ("System Group: My Contacts"), and then:
It works, and the contact is immediately visible in my Android device.
For me, I have to add them to the ContactGroup named
System Group: My Contacts
.Note that
getContactGroup(string)
is an exact name match.I recommend inspecting your ContactGroups for system groups, and then selecting the appropriate one from that list. It's probably the one with the most contacts in it: