이 필드의 라벨을 가져옵니다. 필드, ExtendedField 또는 문자열일 수 있습니다.
// 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());}
// 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');
// 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());}
// 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');
// 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');
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 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"]]