Class PhoneField

전화필드

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

연락처의 전화번호 필드입니다.

메서드

메서드반환 유형간략한 설명
getLabel()Object이 필드의 라벨을 가져옵니다.
isPrimary()Boolean기본 필드 값인지 여부를 가져옵니다.
setAsPrimary()PhoneField이 필드를 기본으로 설정합니다.
setLabel(field)PhoneField이 필드의 라벨을 설정합니다.
setLabel(label)PhoneField이 필드의 라벨을 설정합니다.
메서드반환 유형간략한 설명
deletePhoneField()void이 전화번호 필드를 삭제합니다.
getPhoneNumber()String이 입력란의 전화번호를 가져옵니다.
setPhoneNumber(number)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.
const contacts = ContactsApp.getContactsByName('John Doe');
const addressFields = contacts[0].getAddresses();
for (let 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.
const contacts = ContactsApp.getContactsByName('John Doe');
const addressFields = contacts[0].getAddresses();
Logger.log(addressFields[0].isPrimary());

리턴

Boolean — 기본인지 여부

승인

이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.

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

setAsPrimary()

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

// 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();

리턴

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

매개변수

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

리턴

PhoneField: 연결에 유용한 필드

승인

이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.

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

지원 중단된 메서드

지원 중단되었습니다. 이 함수는 지원 중단되었으며 새 스크립트에서 사용해서는 안 됩니다.

이 전화번호 필드를 삭제합니다.

// Retrieves and deletes the work phone number field for contact 'John
// Doe'
const contacts = ContactsApp.getContactsByName('John Doe');
const phoneFields = contacts[0].getPhones(ContactsApp.Field.WORK_PHONE);
phoneFields[0].deletePhoneField();

승인

이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.

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

지원 중단되었습니다. 이 함수는 지원 중단되었으며 새 스크립트에서 사용해서는 안 됩니다.

이 입력란의 전화번호를 가져옵니다.

// Logs the work phone number for contact 'John Doe'
const contacts = ContactsApp.getContactsByName('John Doe');
const phoneFields = contacts[0].getPhones(ContactsApp.Field.WORK_PHONE);
Logger.log(phoneFields[0].getPhoneNumber());

리턴

String - 숫자(문자열)

승인

이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.

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

지원 중단되었습니다. 이 함수는 지원 중단되었으며 새 스크립트에서 사용해서는 안 됩니다.

이 필드의 전화번호를 설정합니다.

// Sets the work phone number for contact 'John Doe'
const contacts = ContactsApp.getContactsByName('John Doe');
const phoneFields = contacts[0].getPhones(ContactsApp.Field.WORK_PHONE);
phoneFields[0].setPhoneNumber('212-555-1234');

매개변수

이름유형설명
numberString새 전화번호

리턴

PhoneField: 연결에 유용한 필드

승인

이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.

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