非推奨。代わりに、People API アドバンスト サービスを使用してください。
連絡先のメールアドレス フィールド。
メソッド
メソッド | 戻り値の型 | 概要 |
---|---|---|
get | String | このフィールドのアドレスを取得します。 |
get | Object | このフィールドのラベルを取得します。 |
is | Boolean | これが主なフィールド値かどうかを取得します。 |
set |
| このフィールドのアドレスを設定します。 |
set |
| このフィールドをプライマリに設定します。 |
set |
| このフィールドのラベルを設定します。 |
set |
| このフィールドのラベルを設定します。 |
サポート終了のメソッド
メソッド | 戻り値の型 | 概要 |
---|---|---|
| void | このメールアドレスを連絡先から削除します。 |
| String | このメールアドレスの表示名を返します。 |
|
| このメールアドレスの表示名を設定します。 |
詳細なドキュメント
getAddress()
このフィールドのアドレスを取得します。
// Logs the address for the 'Home Address' field for contact 'John Doe'. // Can be used similarly for other fields that contain addresses. const contacts = ContactsApp.getContactsByName('John Doe'); const homeAddress = contacts[0].getAddresses(ContactsApp.Field.HOME_ADDRESS); Logger.log(homeAddress[0].getAddress());
戻る
String
- 住所(文字列)
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
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
setAddress(address)
このフィールドのアドレスを設定します。
// Sets the address for the 'Home Address' field for contact 'John Doe'. // Can be used similarly for other fields that contain addresses. const contacts = ContactsApp.getContactsByName('John Doe'); const homeAddress = contacts[0].getAddresses(ContactsApp.Field.HOME_ADDRESS); homeAddress[0].setAddress('123 Main St, Raleigh, NC, 27601');
パラメータ
名前 | 型 | 説明 |
---|---|---|
address | String | 新しい住所 |
戻る
- チェーンに便利なフィールドEmail
承認
このメソッドを使用するスクリプトには、次のスコープの 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();
戻る
- チェーン用のこの FieldValueEmail
承認
このメソッドを使用するスクリプトには、次のスコープの 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 |
| 新しい標準ラベル |
戻る
- チェーン用のこの FieldValueEmail
承認
このメソッドを使用するスクリプトには、次のスコープの 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 | このフィールドの新しいラベル |
戻る
- チェーンに便利なフィールドEmail
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
サポート終了のメソッド
deleteEmailField()
deleteEmailField()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
このメールアドレスを連絡先から削除します。
// Retrieves and deletes the work email address for contact 'John Doe' const contacts = ContactsApp.getContactsByName('John Doe'); const workEmail = contacts[0].getEmails(ContactsApp.Field.WORK_EMAIL); workEmail[0].deleteEmailField();
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
getDisplayName()
getDisplayName()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
このメールアドレスの表示名を返します。
// Logs the display name for the work email address for contact 'John Doe' const contacts = ContactsApp.getContactsByName('John Doe'); const workEmail = contacts[0].getEmails(ContactsApp.Field.WORK_EMAIL); Logger.log(workEmail[0].getDisplayName());
戻る
String
- このメールの表示名
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
setDisplayName(name)
setDisplayName(name)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
このメールアドレスの表示名を設定します。
// Sets the display name to 'Doe, John' for the work email address for contact // 'John Doe' const contacts = ContactsApp.getContactsByName('John Doe'); const workEmail = contacts[0].getEmails(ContactsApp.Field.WORK_EMAIL); workEmail[0].setDisplayName('Doe, John');
パラメータ
名前 | 型 | 説明 |
---|---|---|
name | String | このメールアドレスの新しい表示名 |
戻る
- チェーンに便利なメールフィールドEmail
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds