Once you define a relate between two tables, you can access the related records from either table participating in the relationship. A selection is required to access related information. You can optionally have your relates appear automatically with each new selection.
Relates can display in other areas from which you access attribute information, such as pop-ups.
View related data in the table view
- Open the attribute table for which you have set up the relate.
- Select the records in the table for which you want to display related records.
You can also interactively select features in the map, and that selection also appears in the table.
- Click Related Data and select the name of the relate you want to access.
The destination table displays with the related records selected. If you created a relate to a table not already part of your map, it opens and is added to the map upon viewing the relates.
View related data in pop-ups
- On the Map tab, activate the Explore tool.
- Click the target feature in the map or scene.
A pop-up window displays attributes associated with the feature.
- Click the down arrow at the bottom of the pop-up window.
- Expand the tree view and select the relate.
The pop-up window displays the attributes of the related data.
Automatically select related records
You can extract knowledge from GIS data by exploring spatial and tabular relationships, and synchronizing feature selections across related tables can be an effective way to do this. By customizing your selection properties, you can automatically select related records. For example, if you select a tax parcel feature, you can quickly review the previous owners and historical sales records for that property.
To enable automatic selection of related records for a layer, do the following:
- Double-click the source layer in the Contents pane to open the Layer Properties dialog box.
- Click the Selection tab and check the Automatically select related data check box.
- Create a new selection in the source layer. You can select features using the following methods:
- Interactively drag a selection graphic in the map.
- Select features from within the attribute table or use geoprocessing tools (Select By Attributes and Select By Location).
- Optionally update the source layer's selection set. The selected records in the related tables will update automatically.
- To turn off automatic selection of related data, uncheck the Automatically select related data check box in the Layer Properties dialog box, or use the Menu drop-down in the table view.
Important usage tips when working with automatic selection of related data
- A selection will only propagate in the from-to, or origin-destination, direction through a relate.
- Ensure you have a clear understanding of other content the layer is related to before you enable automatic selection of related data. To check if any of your layers have preexisting relationships, view the Relates tab on the Layer Properties dialog box.
- While you can enable automatic selection of related records for many layers, selection from a single layer is important since that is the only time the automatic selection behavior is utilized. Selecting across multiple layers with the automatic selection of related data enabled on those layers will not automatically propagate the selections. You must click the Show Related Data button on the feature layer's Data tab or the Table tab to manually select the related data you want to see. This will help ensure clear and understandable results.
- It is possible your data contains a set of relates that loop back around to the starting layer. When this occurs, the selection set will not be passed on any further. In these cases it's recommended to uncheck selection propagation for one or more of the intermediate tables or feature layers.
- When you clear a selection, it also clears the related selection. If, however, you do a partial clear by unselecting features or records from a selection set, the remaining selection is still propagated as if it is a new selection.
Example using automatic selection of related data
Consider a map with two layers, USA_Cities and USA_States, both of which have a populated and standardized field, StateName. The automatic propagation of selection events will yield different results based on the way the relationship between the two layers is defined.
A single relate is defined from USA_Cities (the origin) to USA_States (the destination), based on the StateName field. The option for Automatically select related data is enabled for both layers by opening the Layer Properties dialog box for each layer and checking it. Without any features already selected (or click Clear to clear any existing selection set) in the map, selecting the cities Houston and Dallas, the expected result would be two features are selected in USA_Cities (Houston and Dallas) and one feature is automatically selected in USA_States (Texas). This is because cities can have a many-to-one relationship with their home state.
If the selection set is cleared and the selection begins instead from the state of Texas, then the expected result would be no features selected in USA_Cities and one feature selected in USA_States (Texas). This is because the selection was not made from the origin or source layer where the relate was made. A relate does not traverse in the to-from direction.
In this case, the single relate is defined opposite from Scenario A, where USA_States is related to USA_Cities, based on the StateName field. The option for Automatically select related data is enabled for both layers. Without any features already selected (or click Clear to clear any existing selection set) in the map, selecting the cities of Houston and Dallas, the expected result would be two features selected in USA_Cities (Houston and Dallas) and no features selected in USA_States. This is because the relate cannot traverse in the to-from direction.
If the selection set is cleared and a new selection starts from the state of Texas, the expected result would be one feature selected in USA_States (Texas) and many features automatically selected in the USA_Cities layer (Houston, Austin, Dallas, San Antonio, and so forth). This is because a state has a one-to-many relationship to the cities within it.