Is there any way to use relationship classes with ArcPy to access associated records?

The ArcGIS Idea for there to be An Arcpy method for dealing with related records leads me to believe that there is not currently a solution:

An arcpy method that notes the relationship between the two datasets and allows the user to pull out related records more easily would be helpful. Perhaps the relationship class could be used as a parameter along with the two datasets since the relationship class already contains the logic for how the two datasets are related.

Is the only way to do this with Python to create separate loops for each feature/table?

1 Answer 1


As commented by curtvprice in the ArcGIS Idea you linked to:

Still miss RESELECT KEYFILE in ArcPlot which would do a similar thing. Select records in table 1 and migrate that selection to another table through a pair of key files in the source and destination table, regardless of 1-M,M-1,or M-N cardinality. Workflows exist in geoprocessing but most are clunky.

Implementing this with relates would be very consistent and elegant and also allow the use of stored relationship classes and on the fly relationships created with Add Relate in Pro.

RESELECT KEYFILE was a very useful ArcInfo Workstation command. In the absence of something similar being implemented for ArcPy I think "the only way to do this with Python [continues to be] to create separate loops for each feature/table".

I recommend that you promote the ArcGIS Idea at every opportunity.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.