1

In my old App Script, I use the following syntax:

var contacts = ContactsApp.getContactsByCustomField('tennis', 'Favorite Sport')

See documentation here.

I am now moving to People API. I can't seem to find the documentation for searching people using UserDefined values.

What I have found so far is search by name, not by user defined fields.

This does not search on my user defined fields:

var response = People.People.searchContacts({
  query: "tennis",
  readMask: "names,userDefined"
})
lito
  • 71
  • 1
  • 4

1 Answers1

1

I'm afraid that there is no equivalent in the Advanced People Service for ContactsApp.getContactsByCustomField


From https://developers.google.com/people/api/rest/v1/people/searchContacts

The query matches on a contact's names, nickNames, emailAddresses, phoneNumbers, and organizations fields that are from the CONTACT source.

Regarding "readMask", it is used to specified the fields to be included in the response.


Related

Rubén
  • 34,714
  • 9
  • 70
  • 166