Skip to content

EntityJoin

A single cross-entity JOIN clause for a structured query.

A join pulls related records together by matching a field on the base (left) entity (joinFieldName) to a field on a related (right) entity (relatedFieldName). Pass one EntityJoin per related entity; supplying several composes a multi-entity (multi-join) query. Up to 3 joins are supported (the SDK throws a ValidationError for more), and all of them must share the same JoinType.

A join query must also set selectedFields or aggregates on EntityQueryRecordsOptions, referencing fields as "<EntityName>.<FieldName>" (e.g. "Customer.Name") — bare field names resolve only while unique across the joined entities. Result rows use the same qualified keys; a LEFT join with no match omits the related entity's keys. Joins are not supported on choice-set, relationship, file, encrypted, or system fields, nor on folder-scoped entities.

Example

import { EntityJoin, JoinType } from '@uipath/uipath-typescript/entities';

const join: EntityJoin = {
  entityName: "Order",
  joinType: JoinType.LeftJoin,
  joinFieldName: "customerId",
  relatedEntityName: "Customer",
  relatedFieldName: "Id",
};

Properties

Property Type Description
entityName? string Name of the base (left) entity that owns joinFieldName. Defaults to the queried entity; set it to anchor chained joins.
joinFieldName string Field on the base entity used as the join key.
joinType? JoinType Join type to apply (default: JoinType.LeftJoin).
relatedEntityName string Name of the related (right) entity to join in.
relatedFieldName string Field on relatedEntityName matched against joinFieldName.