Class PhoneField

PhoneField

지원 중단되었습니다. 대신 People API 고급 서비스를 사용하세요.

연락처의 전화번호 입력란.

방법

메서드반환 유형간략한 설명
getLabel()Object이 필드의 라벨을 가져옵니다.
isPrimary()Boolean이 값이 기본 필드 값인지 확인합니다.
setAsPrimary()PhoneField이 필드를 기본으로 설정합니다.
setLabel(field)PhoneField이 필드의 라벨을 설정합니다.
setLabel(label)PhoneField이 필드의 라벨을 설정합니다.

자세한 문서

getLabel()

이 필드의 라벨을 가져옵니다. 필드, 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.
var contacts = ContactsApp.getContactsByName('John Doe');
var addressFields = contacts[0].getAddresses();
for (var i = 0; i < addressFields.length; i++) {
  Logger.log(addressFields[i].getLabel());
}

리턴

Object: 이 필드의 라벨

승인

이 방법을 사용하는 스크립트는 다음 범위 중 하나 이상을 승인해야 합니다.

  • https://www.google.com/m8/feeds

isPrimary()

이 값이 기본 필드 값인지 확인합니다.

// 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.
var contacts = ContactsApp.getContactsByName('John Doe');
var addressFields = contacts[0].getAddresses();
Logger.log(addressFields[0].isPrimary());

리턴

Boolean: 기본인지 여부

승인

이 방법을 사용하는 스크립트는 다음 범위 중 하나 이상을 승인해야 합니다.

  • https://www.google.com/m8/feeds

setAsPrimary()

이 필드를 기본으로 설정합니다.

// Sets the the first address field associated with contact 'John Doe'
// as primary. This method can be similarly called for any field.
var contacts = ContactsApp.getContactsByName('John Doe');
var addressFields = contacts[0].getAddresses();
addressFields[0].setAsPrimary();

리턴

PhoneField: 연결을 위한 이 FieldValue

승인

이 방법을 사용하는 스크립트는 다음 범위 중 하나 이상을 승인해야 합니다.

  • https://www.google.com/m8/feeds

setLabel(field)

이 필드의 라벨을 설정합니다.

// 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.
var contacts = ContactsApp.getContactsByName('John Doe');
var addressFields = contacts[0].getAddresses();
addressFields[0].setLabel(ContactsApp.Field.WORK_ADDRESS);

매개변수

이름유형설명
fieldField새 표준 라벨을

리턴

PhoneField: 연결을 위한 이 FieldValue

승인

이 방법을 사용하는 스크립트는 다음 범위 중 하나 이상을 승인해야 합니다.

  • https://www.google.com/m8/feeds

setLabel(label)

이 필드의 라벨을 설정합니다.

// 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.
var contacts = ContactsApp.getContactsByName('John Doe');
var addressFields = contacts[0].getAddresses();
addressFields[0].setLabel('Apartment');

매개변수

이름유형설명
labelString이 필드의 새 라벨

리턴

PhoneField: 이 필드로, 연결하는 데 유용합니다.

승인

이 방법을 사용하는 스크립트는 다음 범위 중 하나 이상을 승인해야 합니다.

  • https://www.google.com/m8/feeds

지원 중단된 메서드