Class UrlField

שדה URL

הוצא משימוש. במקום זאת, כדאי להשתמש בשירות המתקדם של People API

שדה כתובת URL באיש קשר.

Methods

שיטהסוג הערך המוחזרתיאור קצר
getAddress()Stringאחזור הכתובת של השדה הזה.
getLabel()Objectהפונקציה מקבלת את התווית של השדה הזה.
isPrimary()Booleanהפונקציה מקבלת את הערך של השדה הראשי.
setAddress(address)UrlFieldמגדיר את הכתובת של השדה הזה.
setAsPrimary()UrlFieldהגדרת השדה הזה כראשי.
setLabel(field)UrlFieldהגדרת התווית של השדה הזה.
setLabel(label)UrlFieldהגדרת התווית של השדה הזה.

מסמכים מפורטים

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 – הכתובת כמחרוזת

אישור

סקריפטים שמשתמשים בשיטה הזו דורשים הרשאה עם אחד או יותר מהיקפי הגישה הבאים:

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

getLabel()

הפונקציה מקבלת את התווית של השדה הזה. זה יכול להיות שדה, 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

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 — אם זהו החשבון הראשי

אישור

סקריפטים שמשתמשים בשיטה הזו דורשים הרשאה עם אחד או יותר מהיקפי הגישה הבאים:

  • 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');

פרמטרים

שםסוגתיאור
addressStringהכתובת החדשה

חזרה

UrlField – השדה הזה שימושי לשרשור

אישור

סקריפטים שמשתמשים בשיטה הזו דורשים הרשאה עם אחד או יותר מהיקפי הגישה הבאים:

  • 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();

חזרה

UrlField – ערך השדה הזה לשרשור

אישור

סקריפטים שמשתמשים בשיטה הזו דורשים הרשאה עם אחד או יותר מהיקפי הגישה הבאים:

  • 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);

פרמטרים

שםסוגתיאור
fieldFieldהתווית הרגילה החדשה

חזרה

UrlField – ערך השדה הזה לשרשור

אישור

סקריפטים שמשתמשים בשיטה הזו דורשים הרשאה עם אחד או יותר מהיקפי הגישה הבאים:

  • 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התווית החדשה לשדה הזה

חזרה

UrlField – השדה הזה שימושי לשרשור

אישור

סקריפטים שמשתמשים בשיטה הזו דורשים הרשאה עם אחד או יותר מהיקפי הגישה הבאים:

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

שיטות שהוצאו משימוש