@servicenow/sdk - v4.4.1
    Preparing search index...
    type Relationship = {
        descendant?: boolean;
        inverse?: boolean;
        relationships?: Relationships;
        via:
            | string
            | { [column: string]: string }
            | ((parent: Record, child: Record) => boolean)
            | { child: [string, string]; parent: [string, string] }[];
    }
    Index

    Properties

    descendant?: boolean

    When true, the related record is considered part of the same logical entity as its parent. These records should be processed together as a unit.

    inverse?: boolean

    When true, the relationship direction is reversed - the parent references the child instead of the child referencing the parent

    relationships?: Relationships

    Nested relationships that define how this table relates to other tables

    via:
        | string
        | { [column: string]: string }
        | ((parent: Record, child: Record) => boolean)
        | { child: [string, string]; parent: [string, string] }[]

    Specifies how the tables are related:

    • String: Name of the reference field on the child table pointing to the parent (or vice versa for inverse relationships)
    • Object: Key-value pairs where keys are column names on the child table and values are the matching column names on the parent table (or vice versa for inverse relationships)
    • Array: Array of objects for regex-based matching. Each object contains 'parent' and 'child' properties, where each is a tuple: [columnName, regexPattern]. The regex extracts values from the respective columns using capturing groups, and records are related if all captured groups match between parent and child
    • Function: Takes the parent and child records as arguments and returns a boolean to indicate whether the records are related or not (WARNING: Do not use this unless absolutely necessary as it can negatively impact performance and cannot be serialized by the relationship resolver, requiring changes to the REST API it invokes)