非推奨。代わりに、People API アドバンスト サービスを使用してください。
連絡先の電話番号フィールド。
メソッド
メソッド | 戻り値の型 | 概要 |
---|---|---|
get | Object | このフィールドのラベルを取得します。 |
is | Boolean | これが主なフィールド値かどうかを取得します。 |
set |
| このフィールドをプライマリに設定します。 |
set |
| このフィールドのラベルを設定します。 |
set |
| このフィールドのラベルを設定します。 |
サポート終了のメソッド
メソッド | 戻り値の型 | 概要 |
---|---|---|
| void | この電話番号フィールドを削除します。 |
| String | このフィールドの電話番号を取得します。 |
|
| このフィールドの電話番号を設定します。 |
詳細なドキュメント
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
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
- プライマリかどうか
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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();
戻る
- チェーン用のこの FieldValuePhone
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
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);
パラメータ
名前 | 型 | 説明 |
---|---|---|
field |
| 新しい標準ラベル |
戻る
- チェーン用のこの FieldValuePhone
承認
このメソッドを使用するスクリプトには、次のスコープの 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 | このフィールドの新しいラベル |
戻る
- チェーンに便利なフィールドPhone
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
サポート終了のメソッド
deletePhoneField()
deletePhoneField()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この電話番号フィールドを削除します。
// 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();
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
getPhoneNumber()
getPhoneNumber()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
このフィールドの電話番号を取得します。
// 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
- 数値を文字列として指定
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
setPhoneNumber(number)
setPhoneNumber(number)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
このフィールドの電話番号を設定します。
// 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');
パラメータ
名前 | 型 | 説明 |
---|---|---|
number | String | 新しい番号 |
戻る
- チェーンに便利なフィールドPhone
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds