הוצא משימוש. במקום זאת, כדאי להשתמש בשירות המתקדם של People API
שדה הכתובת באיש קשר.
Methods
שיטה | סוג הערך המוחזר | תיאור קצר |
---|---|---|
get | String | אחזור הכתובת של השדה הזה. |
get | Object | הפונקציה מקבלת את התווית של השדה הזה. |
is | Boolean | הפונקציה מקבלת את הערך של השדה הראשי. |
set |
| מגדיר את הכתובת של השדה הזה. |
set |
| הגדרת השדה הזה כראשי. |
set |
| הגדרת התווית של השדה הזה. |
set |
| הגדרת התווית של השדה הזה. |
מסמכים מפורטים
get Address()
אחזור הכתובת של השדה הזה.
// 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
– הכתובת כמחרוזת
אישור
סקריפטים שמשתמשים בשיטה הזו דורשים הרשאה עם אחד או יותר מהיקפי הגישה הבאים:
-
https://www.google.com/m8/feeds
get Label()
הפונקציה מקבלת את התווית של השדה הזה. זה יכול להיות שדה, 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
is Primary()
הפונקציה מקבלת את הערך של השדה הראשי.
// 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
set Address(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 | הכתובת החדשה |
חזרה
– השדה הזה שימושי לשרשורAddress
אישור
סקריפטים שמשתמשים בשיטה הזו דורשים הרשאה עם אחד או יותר מהיקפי הגישה הבאים:
-
https://www.google.com/m8/feeds
set As Primary()
הגדרת השדה הזה כראשי.
// 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();
חזרה
– ערך השדה הזה לשרשורAddress
אישור
סקריפטים שמשתמשים בשיטה הזו דורשים הרשאה עם אחד או יותר מהיקפי הגישה הבאים:
-
https://www.google.com/m8/feeds
set Label(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 |
| התווית הרגילה החדשה |
חזרה
– ערך השדה הזה לשרשורAddress
אישור
סקריפטים שמשתמשים בשיטה הזו דורשים הרשאה עם אחד או יותר מהיקפי הגישה הבאים:
-
https://www.google.com/m8/feeds
set Label(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 | התווית החדשה לשדה הזה |
חזרה
– השדה הזה שימושי לשרשורAddress
אישור
סקריפטים שמשתמשים בשיטה הזו דורשים הרשאה עם אחד או יותר מהיקפי הגישה הבאים:
-
https://www.google.com/m8/feeds