Mendapatkan label untuk kolom ini. Ini dapat berupa Kolom, ExtendedField, atau String.
// 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.constcontacts=ContactsApp.getContactsByName('John Doe');constaddressFields=contacts[0].getAddresses();for(leti=0;i < addressFields.length;i++){Logger.log(addressFields[i].getLabel());}
Pulang pergi
Object — label untuk kolom ini
Otorisasi
Skrip yang menggunakan metode ini memerlukan otorisasi dengan satu atau beberapa cakupan berikut:
https://www.google.com/m8/feeds
setLabel(label)
Menetapkan label kolom ini.
// 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.constcontacts=ContactsApp.getContactsByName('John Doe');constaddressFields=contacts[0].getAddresses();addressFields[0].setLabel('Apartment');
Parameter
Nama
Jenis
Deskripsi
label
String
label baru untuk kolom ini
Pulang pergi
CustomField — kolom ini, berguna untuk membuat rantai
Otorisasi
Skrip yang menggunakan metode ini memerlukan otorisasi dengan satu atau beberapa cakupan berikut:
https://www.google.com/m8/feeds
Metode yang tidak digunakan lagi
deleteCustomField()
Tidak digunakan lagi. Fungsi ini tidak digunakan lagi dan tidak boleh digunakan dalam skrip baru.
Skrip yang menggunakan metode ini memerlukan otorisasi dengan satu atau beberapa cakupan berikut:
https://www.google.com/m8/feeds
getValue()
Tidak digunakan lagi. Fungsi ini tidak digunakan lagi dan tidak boleh digunakan dalam skrip baru.
Mendapatkan nilai kolom.
// Logs the value of all the custom fields for contact 'John Doe'constcontacts=ContactsApp.getContactsByName('John Doe');constfields=contacts[0].getCustomFields();for(constiinfields){Logger.log(fields[i].getValue());}
Pulang pergi
Object — nilai yang disimpan di kolom
Otorisasi
Skrip yang menggunakan metode ini memerlukan otorisasi dengan satu atau beberapa cakupan berikut:
https://www.google.com/m8/feeds
setLabel(field)
Tidak digunakan lagi. Fungsi ini tidak digunakan lagi dan tidak boleh digunakan dalam skrip baru.
Menetapkan label kolom ini.
// Sets the first custom field associated with contact 'John Doe' to use 'Mail// application' as a label, with 'Gmail' as the value.constcontacts=ContactsApp.getContactsByName('John Doe');constfield=contacts[0].getCustomFields()[0];field.setLabel('Mail application');field.setValue('Gmail');
CustomField — kolom ini, berguna untuk membuat rantai
Otorisasi
Skrip yang menggunakan metode ini memerlukan otorisasi dengan satu atau beberapa cakupan berikut:
https://www.google.com/m8/feeds
setValue(value)
Tidak digunakan lagi. Fungsi ini tidak digunakan lagi dan tidak boleh digunakan dalam skrip baru.
Menetapkan nilai kolom ini.
// Sets the first custom field associated with contact 'John Doe' to use 'Mail// application' as a label, with 'Gmail' as the value.constcontacts=ContactsApp.getContactsByName('John Doe');constfield=contacts[0].getCustomFields()[0];field.setLabel('Mail application');field.setValue('Gmail');
Parameter
Nama
Jenis
Deskripsi
value
Object
nilai baru
Pulang pergi
CustomField — kolom ini, berguna untuk membuat rantai
Otorisasi
Skrip yang menggunakan metode ini memerlukan otorisasi dengan satu atau beberapa cakupan berikut:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2024-12-22 UTC."],[[["`CustomField` is deprecated and the People API advanced service should be used instead."],["It represents a custom field within a Contact and previously allowed for getting, setting, and deleting custom field data."],["`getLabel()` and `setLabel(label)` methods remain available for retrieving and setting the label of a custom field."],["Several methods, including `deleteCustomField()`, `getValue()`, `setLabel(field)`, and `setValue(value)`, are deprecated and should no longer be used."]]],["The `CustomField` in the Contacts API is deprecated in favor of the People API. It allows interacting with a custom field in a contact, using `getLabel()` to retrieve the field's label and `setLabel(label)` to change it. Deprecated methods include `deleteCustomField()` to remove the field, `getValue()` to get the field's value, `setLabel(field)` to set a label, and `setValue(value)` to assign the field's value. These actions require specific authorization scopes.\n"]]