Read a value from a linked object
Copy a field from a linked object using apiSearchBySIDs.
Use case
Snippet
console.info("Fetching the linked object by sid");
if (!objNew.linked) {
return "No linked object provided.";
}
// The link field carries the linked object's _system_object_id.
const sid = objNew.linked._system_object_id;
const found = await apiSearchBySIDs(sid);
if (found && found.length > 0) {
// The fields of the linked object are under its own object type key.
const objecttype = found[0]._objecttype;
return found[0][objecttype].category;
}
return "Linked object not found.";Notes
Last updated