Class CustomField

カスタムフィールド

非推奨。代わりに、People API アドバンスト サービスを使用してください。

連絡先のカスタム フィールド。

メソッド

メソッド戻り値の型概要
getLabel()Objectこのフィールドのラベルを取得します。
setLabel(label)CustomFieldこのフィールドのラベルを設定します。

詳細なドキュメント

getLabel()

このフィールドのラベルを取得します。これは、Field、ExtendedField、または 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.
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 - このフィールドのラベル

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。

  • 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このフィールドの新しいラベル

戻る

CustomField - チェーンに便利なフィールド

承認

このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。

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

サポート終了のメソッド