Select to view content in your preferred language

Add Join in arcgis Pro does not work in Script?

718
2
06-26-2019 07:43 AM
deleted-user-yC5VkbyXzrQR
Deactivated User

In this code I'm trying to create a join in ArcGIS Pro between two separate feature layers. Then look for changes in the data between the two layers and do something when it finds the changes. However, when I try to do the join in the Script, the join doesnt work, BUT if i run that same piece of code for the join in the Python window in ArcGIS Pro the join work. The Script does not fail either it says it successfully completed, but there is no join. 

I'm sure it's something simple. Hope someone can help! 

Thanks.

# Brings in data to map 

#sets the map and project location 
aprx = arcpy.mp.ArcGISProject("CURRENT")
m = aprx.listMaps("Map4")[0]

#Adds the downloaded parcels
m.addDataFromPath(outputFC)
#arcpy.MakeFeatureLayer_management(outputFC, "testingg_3")

arcpy.AddJoin_management("NEW", "APN", "testingg_3", "APN", "KEEP_COMMON")

#arcpy.management.AddJoin("NEW", "APN", "testingg_3", "APN", "KEEP_COMMON")


s = arcpy.SearchCursor('NEW')
		
for row in s:
	if row.getValue("testingg_2.Status_5") != row.getValue("testingg_3.Status_5"):
		arcpy.AddMessage (row.getValue("testingg_2.APN"))
        #print (row.getValue("testingg.APN"))
		
del s 
0 Kudos
2 Replies
CCWeedcontrol
Frequent Contributor

Where is your "NEW" pointing to?

Also why do you have line 9 commented out?

0 Kudos
deleted-user-yC5VkbyXzrQR
Deactivated User

Thanks for the reply. 

I figured out that you cant use the update cursor with a table join anyways. 

So I'm looking for a work around.  

0 Kudos