AnsweredAssumed Answered

Add Join in arcgis Pro does not work in Script?

Question asked by deleted-user-yC5VkbyXzrQR on Jun 26, 2019
Latest reply on Jun 27, 2019 by deleted-user-yC5VkbyXzrQR

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

Outcomes