Update an attributed relationship class

Any relationship class—whether simple or composite, of any particular cardinality—can have attributes. When a relationship class is created with many-to-many cardinality or with attributes, a new intermediate table is created.

This intermediate table contains the following two foreign key fields and each row in this table is used to map the associations between one origin object and one destination object.

  • The Origin Foreign Key field is associated with the primary key field from the origin table or feature class.
  • The Destination Foreign Key field is associated with the primary key field in the destination table or feature class.

For example, to help rangers and tourists locate specific activities—such as swimming, hiking, and boating available at various facilities in Grand Teton National Park—a many-to-many relationship class has been created between the Facilities feature class and the Activities stand-alone table. In this scenario, the Lizard Creek Campground now contains boating activities, and a relationship between these objects needs to be added to the relationship class.

Many-to-many relationships require the use of an intermediate table which can store attributes for the relationship itself.
A many-to-many (M:N) cardinality diagram between a Facilities feature class and an Activities table shows that a facility can host multiple activities, and an activity can be performed in more than one facility.
Tip:

To learn more about attributed relationship classes and how they can be applied to a real-world scenario, see the Explore a many-to-many relationship class ArcGIS blog article. This blog provides a more in-depth review of the workflow steps and includes the data needed to create and populate a many-to-many attributed relationship class to help maintain park data validity. The Access an intermediate table and Add a relationship between objects sections below contain images created using data available in this blog.

When the intermediate table is created using the Create Relationship Class tool, only the fields are generated for you. ArcGIS does not automatically associate origin objects with their destination objects, so you must manually add the relationships between objects to populate the rows. Adding relationships between objects can be accomplished in an edit session by selecting related features or rows in the two participating object classes and adding the relationship to the intermediate table using the Attributes pane. The Attributes pane can be accessed by clicking the Attributes button Attributes on the Edit tab. Once a relationship has been added to the intermediate table, the foreign key fields will be automatically populated with the related primary key values, and data can be entered in any additional attribute fields. This process must be repeated for all the sets of related features.

Note:

Once an attributed relationship class is created, you can add the attributed relationship class to your map. The attributed relationship class will appear as a table you can open in the Contents pane. Additionally, from the Fields view, you can add and remove user-defined fields in this intermediate table. However, this intermediate table is not recognized as an object class in the geodatabase. As a result, geodatabase behaviors such as attribute rules, domains, subtypes, contingent values, and default values cannot be applied or used with this intermediate table.

Access an intermediate table

Before adding a relationship between two objects, you must first create a relationship class between the feature classes or tables containing the objects you want to relate. Create an attributed relationship class using the Create Relationship Class or the Table To Relationship Class geoprocessing tool in ArcGIS Pro.

Once an attributed relationship class is created, the intermediate table for this attributed relationship class can be accessed.

See the Add a relationship between objects section below for steps to add rows in the intermediate table of an attributed relationship class.

Tip:

The following examples and images were created using data available to download from the Explore a many-to-many relationship class ArcGIS blog article.

  1. In ArcGIS Pro, from the Catalog pane, under the Databases folder, click to expand the geodatabase containing the relationship class that is attributed.
    Note:

    To add, delete, or update records in an attributed relationship class that resides in an enterprise geodatabase, you must be connected to the enterprise geodatabase as the owner of the relationship class.

  2. Optionally, right-click the relationship class in the Catalog pane and click Properties.

    You can manage relationship class properties from the General, Rules, and Manage tabs.

    Relationship Class Properties dialog box
    Tip:

    The geodatabase functionality listed under the Manage tab on the Relationship Class Properties dialog box is enabled, as these are the properties of an attributed relationship class.

  3. Right-click the relationship class in the Catalog pane and click Add to Current Map.

    When adding a relationship class that is attributed to your map in ArcGIS Pro, the intermediate table created for the attributed relationship class will be added as a table in the Contents pane and will appear under the Standalone Tables section. The name for this intermediate table will be the same as the relationship class.

    The intermediate table of an attributed relationship class in the Contents pane

  4. Right-click the feature classes or tables participating in the relationship class from the Catalog pane and click Add to Current Map.
  5. Optionally, from the Contents pane, under Standalone Tables, right-click the intermediate table and click Open to review the fields and attributes.

    For example, if a relationship class is created with the Table To Relationship Class tool, which requires an existing table populated with additional attributes about the relationship, the resulting intermediate table could look similar to the following. In this example, the intermediate table for this attributed relationship class contains all the valid relationships between the Facilities feature class and the Outdoor activities table, where the Facility_ID field is the origin foreign key and the Activity_ID field is the destination foreign key.

    The fields and attributes populated in an intermediate table of an attributed relationship class created using the Table To Relationship Class tool

    If a relationship class is created with the Create Relationship Class tool, the intermediate table will only contain the required fields, and the values within these fields must be populated, as ArcGIS does not map the associations between origin and destination objects. Using this tool to create an attributed relationship class means the intermediate table must be populated manually, and the resulting intermediate table could look similar to the following.

    Only the required field names appear in an intermediate table of an attributed relationship class created using the Create Relationship Class tool.

Add a relationship between objects

You can use the Attributes pane Attributes to add relationships between two objects. In a many-to-many or attributed relationship class, the intermediate table maps and stores associations between the origin and destination objects. When a relationship is created between two objects in this type of relationship class, a new row is added to that intermediate table. This row is populated with the values from the primary keys in the origin and destination objects.

To add relationships between objects, use these steps to add rows in the intermediate table of an attributed relationship class:

  1. On the Edit tab, in the Selection group, click the Select tool Select.
  2. Use the Select tool Select to select related origin and destination objects interactively. If a table participates in the relationship, select Open to open the table from the Contents pane and select the desired rows.

    For example, using the image at the top of this topic, the Lizard Creek Campground in the Facilities feature class must be associated with the Boating activity in the Outdoor Activities table. The Lizard Creek Campground (origin feature object) and the Boating (destination feature object) have been selected.

    Selected related objects

  3. Click the Attributes button Attributes on the Edit tab to open the Attributes pane.

    The selected origin and destination features appear in the Attributes pane.

    Selected features in the Attributes pane

  4. Click to expand the selected origin feature in the Attributes pane and right-click the relationship class label.
  5. Click the Add Selected To Relationship option.
    Add Selected To Relationship
    Lizard Creek Campground in the Facilities feature class has been associated with the Boating activity in the Outdoor Activities table.
    • The Attributes pane updates to display the added relationship between the selected origin and destination features.
      Updated Attributes pane
    • A row is added to the intermediate table, and the foreign key fields are populated with the related primary key values.
      Updated intermediate table
  6. Repeat steps 2 through 5 to populate the intermediate table with all the appropriate relationships between objects.
  7. Save your edits to save the relationships and the new data in the intermediate table.
    Save edits
  8. Learn about relationship class usage tips and options available for modifying a relationship class.

Related topics