Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm struggling to get a search cursor to work on a joined table view.

I've used search cursors before, but never on data that has been joined. Arcpy keeps saying that some of my joined fields don't exist.

I used arcpy.ListFields() and sure enough, the fields are there. Some of them look different though. They look like this:

Shapefile1.FID Shapefile1.LPOLY source_id title author

My search cursor code:

searchRows = arcpy.SearchCursor(theJoinedView)

for row in searchRows:
    if row.source_id == None:

It says Shapefile1.FID does not exist, when it should. Any ideas?

share|improve this question
up vote 9 down vote accepted

There are two ways to get attribute values using cursors. First, you could use a descriptor with the field name. This is what your code does, where you have row followed by a . followed by the field name. Second, you can use the getValue method of the row class, and pass in the field name as a string.

Although row.FID is perfectly valid, row.Shapefile1.FID confuses Python, because it thinks you want the FID property of the Shapefile1 property of row, when in fact you just want the Shapefile1.FID property of row. To avoid confusion, you should use getValue. So instead of doing this:


Try this:

share|improve this answer
Thank you! This worked perfectly – jabeoogie Nov 15 '12 at 1:12
@user1191849 Glad to hear that! Be sure to mark the question as answered (the checkmark button) when you get a chance. – dmahr Nov 15 '12 at 1:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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