Selecting related tables in ModelBuilder or Python

09-24-2012 01:50 PM
New Contributor III
If I have a feature class and a table in a geodatabase, and there is a relate between them, I can very easily select a bunch of features in the feature layer in ArcMap and use the Related Tables pulldown in the table attribute window to select only those features in the table that relate to the selected features in the feature class.  That's basic GIS 101, right? 

What I am having trouble finding is a way to do the same thing, but using ArcToolbox/ModelBuilder or Python instead, so that I could include such queries in scheduled tasks.  I have searched the help documentation and looked up in the various forums, but haven't found anything promising.  Has anyone any suggestions?  Thanks.

1 Reply
Occasional Contributor III
Hi Stephan

You are going to have to use a ModelBuilder tool called "Calculate Value" and write an ArcPy expression using a Search Cursor:

Calculate Value
Search Cursor

Hope this gets you going 🙂

0 Kudos