Lấy nhãn cho trường này. Đây có thể là Trường, ExtendedField hoặc Chuỗi.
// 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());}
Cầu thủ trả bóng
Object – nhãn cho trường này
Ủy quyền
Các tập lệnh sử dụng phương thức này yêu cầu được uỷ quyền với một hoặc nhiều phạm vi sau:
https://www.google.com/m8/feeds
setLabel(label)
Đặt nhãn của trường này.
// 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');
Tham số
Tên
Loại
Mô tả
label
String
nhãn mới cho trường này
Cầu thủ trả bóng
CustomField – trường này hữu ích cho việc tạo chuỗi
Ủy quyền
Các tập lệnh sử dụng phương thức này yêu cầu được uỷ quyền với một hoặc nhiều phạm vi sau:
https://www.google.com/m8/feeds
Các phương thức ngừng hoạt động
deleteCustomField()
Không dùng nữa. Hàm này không còn được dùng nữa và không nên được sử dụng trong các tập lệnh mới.
Các tập lệnh sử dụng phương thức này yêu cầu được uỷ quyền với một hoặc nhiều phạm vi sau:
https://www.google.com/m8/feeds
getValue()
Không dùng nữa. Hàm này không còn được dùng nữa và không nên được sử dụng trong các tập lệnh mới.
Lấy giá trị của trường.
// 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());}
Cầu thủ trả bóng
Object – giá trị được lưu trữ trong trường
Ủy quyền
Các tập lệnh sử dụng phương thức này yêu cầu được uỷ quyền với một hoặc nhiều phạm vi sau:
https://www.google.com/m8/feeds
setLabel(field)
Không dùng nữa. Hàm này không còn được dùng nữa và không nên được sử dụng trong các tập lệnh mới.
Đặt nhãn của trường này.
// 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 – trường này hữu ích cho việc tạo chuỗi
Ủy quyền
Các tập lệnh sử dụng phương thức này yêu cầu được uỷ quyền với một hoặc nhiều phạm vi sau:
https://www.google.com/m8/feeds
setValue(value)
Không dùng nữa. Hàm này không còn được dùng nữa và không nên được sử dụng trong các tập lệnh mới.
Đặt giá trị của trường này.
// 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');
Tham số
Tên
Loại
Mô tả
value
Object
giá trị mới
Cầu thủ trả bóng
CustomField – trường này hữu ích cho việc tạo chuỗi
Ủy quyền
Các tập lệnh sử dụng phương thức này yêu cầu được uỷ quyền với một hoặc nhiều phạm vi sau:
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 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"]]