@halix/action-sdk
    Preparing search index...

    Function getRelatedObjectsAsObservable

    • getRelatedObjectsAsObservable retrieves an array of objects from the the database. The objects returned are related to a parent through a defined relationship in the schema. In a typical setup, action's auth token must have scope access to the parent object in order to access all of its related objects.

      It is common to use getRelatedObjects to retrieve all objects belonging to the current user proxy or organization proxy. For example, in a user context where the current user proxy element is "customer," an action might want to retrieve all "purchase" objects related to the current customer. Similarly, in an organization context where the current organization proxy is "business," an action might want to retrieve all "employee" objects related to the current business.

      Parameters

      • parentElementId: string

        The ID of the parent element

      • parentKey: string

        The key of the parent element

      • elementId: string

        The ID of the element

      • Optionalfilter: string

        Optional filter criteria for the query; if not provided, all related objects will be returned

      • OptionalfetchedRelationships: string[]

        Optional array of relationships to fetch; if provided, the returned objects will include the specified related objects as nested objects

      Returns Observable<any[]>

      Observable resolving to an array of objects