The CloudSponge Contact Picker uses an array of Contact objects to represent a user’s address book. This data structure is most commonly used by developers who implement the beforeDisplayContacts()
and afterSubmitContacts()
callbacks since it’s passed in as an argument there.
Properties |
Description |
contact.first_name |
The contact’s first name. |
contact.last_name |
The contact’s last name. |
contact.email |
An array of Email objects for the contact. |
contact.email[i].address |
The email address. |
contact.email[i].type |
The type associated with the email. Possible values depend on the address book source. |
contact.phone |
An array of Phone objects for the contact. |
contact.phone[i].number |
The phone number. |
contact.phone[i].type |
The type associated with the phone number. Possible values depend on the address book source. |
contact.address |
undefined or an array of Address objects for the contact. Each address has the properties: address and type . |
contact.address[i].formatted |
undefined or the full mailing address, formatted with line breaks (\n ). |
contact.address[i].street |
The street portion of the mailing address. |
contact.address[i].city |
The city portion of the mailing address. |
contact.address[i].region |
The state or province portion of the mailing address. |
contact.address[i].country |
The city portion of the mailing address. |
contact.address[i].postal_code |
The zip or postal code portion of the mailing address. |
contact.address[i].type |
The type associated with the mailing address. Possible values depend on the address book source. |
contact.job_title |
The job title, if any is associated with the contact. |
contact.companies |
An array of strings representing the companies that the contact is associated with, when available. |
contact.groups |
An array of strings representing the groups that the contact is associated with, when available. The groups are defined by the owner of the addres book. |
contact.dob |
A string representing the date of birth of the contact, if available. The date format is YYYY-MM-DD . |
contact.birthday |
A string representing the month and day of the contact’s birthday, if available. The format is MM-DD . |
Functions |
Usage |
contact.fullName() |
Returns a string with the first and last name for the contact joined with a space. |
contact.primaryEmail() |
Returns a string with the primary email address for the contact. |
contact.selectedEmail() |
Returns a string with the email address that was selected in a drop down list. If the Choose Contacts page was not displayed, it returns the value of contact.primaryEmail() . |
contact.primaryPhone() |
Returns a string with the primary phone number for the contact. |
contact.selectedPhone() |
Returns a string with the phone number that was selected in a drop down list. If the Choose Contacts page was not displayed, it returns the value of contact.primaryPhone() . |