Is there a way to grab only the name of the linked Contact? (I’d love to not have to manually enter a contact’s name; I’ve just been linking to a record in iOS’s Contacts.)
With my almost nonexistent knowledge of scripting, I’ve only gotten it to return the entirety of the iOS record, i.e.{ id = “blablabla”; name = “blablabla”; phoneNumbers = {home = blablabla; mobile = blablabla;};} etc
Your contact field returns just a regular javascript object. To get the name, you can use contact.name
or contact["name"]
.
Example:
function Get_Contact_Name() {
var contact_id = 'fld-xxx';
var contact = record.getFieldValue(contact_id);
return contact["name"];
}
Get_Contact_Name();