I've got 19 feature classes, with a single field in each one that I am interested in. I want to pull that field from each one (index 63 on each feature class), and join those fields to a single feature class (inDWR). In the workspace, I've got numerous fc's, and the 19 aforementioned feature classes all end with 'EVTP' in their file name. So, I've distilled a list accordingly (extractList):
import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = 'C:\\LaPlata\\LaPlataFmTops.gdb'
inDWR = env.workspace + '\\DWR_ConstructedAbandonedReplaced'
tempList = arcpy.ListFeatureClasses() # This contains too many files, some of which I'm not interested in
extractList = []
for fc in tempList:
if fc.endswith ('EVTP'):
extractList.append(fc)
print (extractList) #contains only the fc's I'm interested in
for fc in extractList:
fieldList = arcpy.ListFields(fc)
joinField = fieldList[4] #this is == 'Permit', and is the join field for the input table and the fc
fieldValue = fieldList[63] #field I want to join from each fc to inDWR
arcpy.JoinField_management (inDWR, joinField, fc, joinField, fieldValue)
I keep getting this error:
Runtime error
Traceback (most recent call last):
File "<string>", line 6, in <module> #This would be the arcpy.JoinField_management line
File "c:\program files (x86)\arcgis\desktop10.6\arcpy\arcpy\management.py", line 6593, in JoinField
raise e
RuntimeError: Object: Error in executing tool