Relationship

AMD: require(["esri/layers/support/Relationship"], (Relationship) => { /* code goes here */ });
ESM: import Relationship from "@arcgis/core/layers/support/Relationship";
Class: esri/layers/support/Relationship
Inheritance: Relationship Accessor
Since: ArcGIS API for JavaScript 4.7

Describes a layer's relationship with another layer or table. These relationships are listed in the ArcGIS Services directory as described in the REST API documentation.

See also:

Constructors

new Relationship(properties)
Parameter:
properties Object
optional

See the properties for a list of all the properties that may be passed into the constructor.

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
Show inherited properties Hide inherited properties
Name Type Summary Class
Stringmore details

The cardinality which specifies the number of objects in the origin FeatureLayer related to the number of objects in the destination FeatureLayer.

more detailsRelationship
Booleanmore details

Indicates whether the relationship is composite.

more detailsRelationship
Stringmore details

The name of the class.

more detailsAccessor
Numbermore details

The unique ID for the relationship.

more detailsRelationship
Stringmore details

The field used to establish the relate within the FeatureLayer.

more detailsRelationship
Stringmore details

The key field in an attributed relationship class table that matches the keyField.

more detailsRelationship
Stringmore details

The name of the relationship.

more detailsRelationship
Numbermore details

The unique ID of the related FeatureLayer.

more detailsRelationship
Numbermore details

The relationship table id.

more detailsRelationship
Stringmore details

Indicates whether the table participating in the relationship is the origin or destination table.

more detailsRelationship

Property Details

cardinality String

The cardinality which specifies the number of objects in the origin FeatureLayer related to the number of objects in the destination FeatureLayer. Please see the Desktop help for additional information on cardinality.

Possible Values:"one-to-one"|"one-to-many"|"many-to-many"

composite Boolean
Since: ArcGIS API for JavaScript 4.16

Indicates whether the relationship is composite. In a composite relationship, a destination object cannot exist independently of its origin object.

declaredClass Stringreadonly inherited

The name of the class. The declared class name is formatted as esri.folder.className.

id Number

The unique ID for the relationship. These ids for the relationships the FeatureLayer participates in are listed in the ArcGIS Services directory.

keyField String

The field used to establish the relate within the FeatureLayer.

keyFieldInRelationshipTable String
Since: ArcGIS API for JavaScript 4.16

The key field in an attributed relationship class table that matches the keyField. This is returned only for attributed relationships.

name String

The name of the relationship.

relatedTableId Number

The unique ID of the related FeatureLayer.

relationshipTableId Number
Since: ArcGIS API for JavaScript 4.16

The relationship table id.

role String
Since: ArcGIS API for JavaScript 4.16

Indicates whether the table participating in the relationship is the origin or destination table.

Possible Values:"origin"|"destination"

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.