Veraltet. Verwenden Sie stattdessen den erweiterten Dienst der People API.
Ein Telefonnummernfeld in einem Kontakt.
Methoden
| Methode | Rückgabetyp | Kurzbeschreibung | 
|---|---|---|
| get | Object | Ruft das Label für dieses Feld ab. | 
| is | Boolean | Gibt an, ob dies der Wert des Hauptfelds ist. | 
| set |  | Legt dieses Feld als primär fest. | 
| set |  | Legt das Label dieses Felds fest. | 
| set |  | Legt das Label dieses Felds fest. | 
Detaillierte Dokumentation
get
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
is
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
set
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
Phone
Autorisierung
Scripts, die diese Methode verwenden, erfordern eine Autorisierung für einen oder mehrere der folgenden Bereiche:
- 
https://www.google.com/m8/feeds
set
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
Phone
Autorisierung
Scripts, die diese Methode verwenden, erfordern eine Autorisierung für einen oder mehrere der folgenden Bereiche:
- 
https://www.google.com/m8/feeds
set
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
Phone
Autorisierung
Scripts, die diese Methode verwenden, erfordern eine Autorisierung für einen oder mehrere der folgenden Bereiche:
- 
https://www.google.com/m8/feeds