Veraltet. Verwenden Sie stattdessen den erweiterten Dienst der People API.
Ein benutzerdefiniertes Feld in einem Kontakt.
Methoden
Methode | Rückgabetyp | Kurzbeschreibung |
---|---|---|
get | Object | Ruft das Label für dieses Feld ab. |
set |
| Legt das Label dieses Felds fest. |
Eingestellte Methoden
Methode | Rückgabetyp | Kurzbeschreibung |
---|---|---|
| void | Dieses Feld wird gelöscht. |
| Object | Ruft den Wert des Felds ab. |
|
| Legt das Label dieses Felds fest. |
|
| Legt den Wert dieses Felds fest. |
Detaillierte Dokumentation
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
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ützlichCustom
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
deleteCustomField()
deleteCustomField()
Veraltet. Diese Funktion wurde eingestellt und sollte in neuen Scripts nicht verwendet werden.
Dieses Feld wird gelöscht.
const contacts = ContactsApp.getContactsByName('John Doe'); const fields = contacts[0].getCustomFields(); for (let i = 0; i < fields.length; i++) { if (fields[i].getLabel() === 'foo') { fields[i].deleteCustomField(); } }
Autorisierung
Scripts, die diese Methode verwenden, erfordern eine Autorisierung für einen oder mehrere der folgenden Bereiche:
-
https://www.google.com/m8/feeds
getValue()
getValue()
Veraltet. Diese Funktion wurde eingestellt und sollte in neuen Scripts nicht verwendet werden.
Ruft den Wert des Felds ab.
// Logs the value of all the custom fields for contact 'John Doe' const contacts = ContactsApp.getContactsByName('John Doe'); const fields = contacts[0].getCustomFields(); for (const i in fields) { Logger.log(fields[i].getValue()); }
Rückflug
Object
: Der im Feld gespeicherte Wert.
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)
setLabel(field)
Veraltet. Diese Funktion wurde eingestellt und sollte in neuen Scripts nicht verwendet werden.
Legt das Label dieses Felds fest.
// Sets the first custom field associated with contact 'John Doe' to use 'Mail // application' as a label, with 'Gmail' as the value. const contacts = ContactsApp.getContactsByName('John Doe'); const field = contacts[0].getCustomFields()[0]; field.setLabel('Mail application'); field.setValue('Gmail');
Parameter
Name | Typ | Beschreibung |
---|---|---|
field |
| das neue Standardlabel |
Rückflug
– dieses Feld ist für die Verkettung nützlichCustom
Autorisierung
Scripts, die diese Methode verwenden, erfordern eine Autorisierung für einen oder mehrere der folgenden Bereiche:
-
https://www.google.com/m8/feeds
setValue(value)
setValue(value)
Veraltet. Diese Funktion wurde eingestellt und sollte in neuen Scripts nicht verwendet werden.
Legt den Wert dieses Felds fest.
// Sets the first custom field associated with contact 'John Doe' to use 'Mail // application' as a label, with 'Gmail' as the value. const contacts = ContactsApp.getContactsByName('John Doe'); const field = contacts[0].getCustomFields()[0]; field.setLabel('Mail application'); field.setValue('Gmail');
Parameter
Name | Typ | Beschreibung |
---|---|---|
value | Object | den neuen Wert |
Rückflug
– dieses Feld ist für die Verkettung nützlichCustom
Autorisierung
Scripts, die diese Methode verwenden, erfordern eine Autorisierung für einen oder mehrere der folgenden Bereiche:
-
https://www.google.com/m8/feeds