Skip to main content
Version: v4.5

Creating relationships

To create a relationship, define a Relationship object. See the following Relationship object code example:

let relationship = {    _userType: "child_item_rel", // A unique or shared relationship type    _relatedUserItemDbId: "1e7433c4-a3de-4c15-b8fb-657c1d9b814c", // The parent item’s collection id    _relatedTolds: [ // An array of the child items’ ids      "9becc0cd-ec1a-4706-85a3-0520a4667f24",       "70b65b8b-9e8d-4d02-839d-9c568538dce3"    ],     _relatedFromld: "006ac49-c622-4854-8b6b-7bf4f3155872", // The parent item’s id    _relatedUserType: "child_item_col", // The child item collection’s user type};

For more information on this schema, see the Relationship schema.

To add your relationship to the Item Service, use one of the following JavaScript methods with the IafItemSvc API: