Veraltet. Verwenden Sie stattdessen den erweiterten Dienst der People API.
Ein Feld für Instant Messaging in einem Kontakt.
Methoden
Methode | Rückgabetyp | Kurzbeschreibung |
---|---|---|
get | String | Rufen Sie die Adresse für dieses Feld ab. |
get | Object | Ruft das Label für dieses Feld ab. |
is | Boolean | Gibt an, ob dies der Wert des Hauptfelds ist. |
set |
| Legt die Adresse dieses Felds fest. |
set |
| Legt dieses Feld als primär fest. |
set |
| Legt das Label dieses Felds fest. |
set |
| Legt das Label dieses Felds fest. |
Eingestellte Methoden
Methode | Rückgabetyp | Kurzbeschreibung |
---|---|---|
| void | Löscht dieses Feld für Instant Messaging. |
Detaillierte Dokumentation
getAddress()
Rufen Sie die Adresse für dieses Feld ab.
// Logs the address for the 'Home Address' field for contact 'John Doe'.
// Can be used similarly for other fields that contain addresses.
const contacts = ContactsApp.getContactsByName('John Doe');
const homeAddress = contacts[0].getAddresses(ContactsApp.Field.HOME_ADDRESS);
Logger.log(homeAddress[0].getAddress());
Rückflug
String
: Adresse als String
Autorisierung
Scripts, die diese Methode verwenden, erfordern eine Autorisierung für einen oder mehrere der folgenden Bereiche:
-
https://www.google.com/m8/feeds
getLabel()
Ruft das Label für dieses Feld ab. Dies kann ein Feld, ein erweitertes Feld oder ein String sein.
// Logs the label for all the address fields associated with contact
// 'John Doe'. This method can be similarly called for any field that has
// a label.
const contacts = ContactsApp.getContactsByName('John Doe');
const addressFields = contacts[0].getAddresses();
for (let i = 0; i < addressFields.length; i++) {
Logger.log(addressFields[i].getLabel());
}
Rückflug
Object
– das Label für dieses Feld
Autorisierung
Scripts, die diese Methode verwenden, erfordern eine Autorisierung für einen oder mehrere der folgenden Bereiche:
-
https://www.google.com/m8/feeds
isPrimary()
Gibt an, ob dies der Wert des Hauptfelds ist.
// Logs whether or not the first address field associated with contact
// 'John Doe' is labeled as primary. This method can be similarly called
// for any field.
const contacts = ContactsApp.getContactsByName('John Doe');
const addressFields = contacts[0].getAddresses();
Logger.log(addressFields[0].isPrimary());
Rückflug
Boolean
– ob es sich um die primäre Adresse handelt
Autorisierung
Scripts, die diese Methode verwenden, erfordern eine Autorisierung für einen oder mehrere der folgenden Bereiche:
-
https://www.google.com/m8/feeds
setAddress(address)
Legt die Adresse dieses Felds fest.
// Sets the address for the 'Home Address' field for contact 'John Doe'.
// Can be used similarly for other fields that contain addresses.
const contacts = ContactsApp.getContactsByName('John Doe');
const homeAddress = contacts[0].getAddresses(ContactsApp.Field.HOME_ADDRESS);
homeAddress[0].setAddress('123 Main St, Raleigh, NC, 27601');
Parameter
Name | Typ | Beschreibung |
---|---|---|
address | String | die neue Adresse |
Rückflug
– dieses Feld ist für die Verkettung nützlichIMField
Autorisierung
Scripts, die diese Methode verwenden, erfordern eine Autorisierung für einen oder mehrere der folgenden Bereiche:
-
https://www.google.com/m8/feeds
setAsPrimary()
Legt dieses Feld als primär fest.
// Sets the first address field associated with contact 'John Doe'
// as primary. This method can be similarly called for any field.
const contacts = ContactsApp.getContactsByName('John Doe');
const addressFields = contacts[0].getAddresses();
addressFields[0].setAsPrimary();
Rückflug
– diese FieldValue für die VerkettungIMField
Autorisierung
Scripts, die diese Methode verwenden, erfordern eine Autorisierung für einen oder mehrere der folgenden Bereiche:
-
https://www.google.com/m8/feeds
setLabel(field)
Legt das Label dieses Felds fest.
// Sets the label to 'Work' for the first address field associated
// with contact 'John Doe'. This method can be similarly called for any
// field that has a label.
const contacts = ContactsApp.getContactsByName('John Doe');
const addressFields = contacts[0].getAddresses();
addressFields[0].setLabel(ContactsApp.Field.WORK_ADDRESS);
Parameter
Name | Typ | Beschreibung |
---|---|---|
field |
| das neue Standardlabel |
Rückflug
– diese FieldValue für die VerkettungIMField
Autorisierung
Scripts, die diese Methode verwenden, erfordern eine Autorisierung für einen oder mehrere der folgenden Bereiche:
-
https://www.google.com/m8/feeds
setLabel(label)
Legt das Label dieses Felds fest.
// Sets the label to 'Apartment' for the first address field associated
// with contact 'John Doe'. This method can be similarly called for any
// field that has a label.
const contacts = ContactsApp.getContactsByName('John Doe');
const addressFields = contacts[0].getAddresses();
addressFields[0].setLabel('Apartment');
Parameter
Name | Typ | Beschreibung |
---|---|---|
label | String | das neue Label für dieses Feld |
Rückflug
– dieses Feld ist für die Verkettung nützlichIMField
Autorisierung
Scripts, die diese Methode verwenden, erfordern eine Autorisierung für einen oder mehrere der folgenden Bereiche:
-
https://www.google.com/m8/feeds
Eingestellte Methoden
deleteIMField()
deleteIMField()
Veraltet. Diese Funktion wurde eingestellt und sollte in neuen Scripts nicht verwendet werden.
Löscht dieses Feld für Instant Messaging.
// Retrieves and deletes the AIM instant messaging field for contact 'John
// Doe'
const contacts = ContactsApp.getContactsByName('John Doe');
const imFields = contacts[0].getIMs(ContactsApp.Field.AIM);
imFields[0].deleteIMField();
Autorisierung
Scripts, die diese Methode verwenden, erfordern eine Autorisierung für einen oder mehrere der folgenden Bereiche:
-
https://www.google.com/m8/feeds