非推奨。代わりに、People API アドバンスト サービスを使用してください。
連絡先のカスタム フィールド。
メソッド
メソッド | 戻り値の型 | 概要 |
---|---|---|
get | Object | このフィールドのラベルを取得します。 |
set |
| このフィールドのラベルを設定します。 |
サポート終了のメソッド
メソッド | 戻り値の型 | 概要 |
---|---|---|
| void | このフィールドを削除します。 |
| Object | フィールドの値を取得します。 |
|
| このフィールドのラベルを設定します。 |
|
| このフィールドの値を設定します。 |
詳細なドキュメント
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');
パラメータ
名前 | 型 | 説明 |
---|---|---|
label | String | このフィールドの新しいラベル |
戻る
- チェーンに便利なフィールドCustom
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
サポート終了のメソッド
deleteCustomField()
deleteCustomField()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
このフィールドを削除します。
const contacts = ContactsApp.getContactsByName('John Doe'); const fields = contacts[0].getCustomFields(); for (let i = 0; i < fields.length; i++) { if (fields[i].getLabel() === 'foo') { fields[i].deleteCustomField(); } }
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
getValue()
getValue()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
フィールドの値を取得します。
// Logs the value of all the custom fields for contact 'John Doe' const contacts = ContactsApp.getContactsByName('John Doe'); const fields = contacts[0].getCustomFields(); for (const i in fields) { Logger.log(fields[i].getValue()); }
戻る
Object
- フィールドに保存されている値
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
setLabel(field)
setLabel(field)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
このフィールドのラベルを設定します。
// Sets the first custom field associated with contact 'John Doe' to use 'Mail // application' as a label, with 'Gmail' as the value. const contacts = ContactsApp.getContactsByName('John Doe'); const field = contacts[0].getCustomFields()[0]; field.setLabel('Mail application'); field.setValue('Gmail');
パラメータ
名前 | 型 | 説明 |
---|---|---|
field |
| 新しい標準ラベル |
戻る
- チェーンに便利なフィールドCustom
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
setValue(value)
setValue(value)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
このフィールドの値を設定します。
// Sets the first custom field associated with contact 'John Doe' to use 'Mail // application' as a label, with 'Gmail' as the value. const contacts = ContactsApp.getContactsByName('John Doe'); const field = contacts[0].getCustomFields()[0]; field.setLabel('Mail application'); field.setValue('Gmail');
パラメータ
名前 | 型 | 説明 |
---|---|---|
value | Object | 新しい値 |
戻る
- チェーンに便利なフィールドCustom
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds