Thanks Jeff! I ended up not using field mapping after all - I worked around it by renaming the fields in all my different datasets the same thing so they'd map together automatically. Still not sure what went wrong with my program, but it works now.
... View more
Hi. I'm having difficulty with field mapping in arcpy - it keeps throwing this error: "The attribute 'outputField' is not supported on this instance of FieldMap." and I'm not sure why. It never manages to get past the first instance, but if I take that part out it complains that streamorder isn't declared. I swear I copied this almost word for word from the documentation, and I'm really not sure why it's failing. Not sure if this is the right place for this question, so if there's somewhere else I should ask please let me know! Here's my code: #setting workspaces and paths arcpy.env.workspace = path.join(workspace, outgdb, geodataset) canadafcs = arcpy.ListFeatureClasses() print("Geodataset and feature classes found.") #separating feature classes by whether they abbreviate the field name or not #creating blank lists fullwords =  abbrev =  #running a for loop to get through the feature classes for fc in canadafcs: fieldlist = arcpy.ListFields(fc) if "STREAM_ORDER" in fieldlist: fullwords.append(fc) elif "STRMRDR" in fieldlist: abbrev.append(fc) print("Feature classes separated by field name format.") #setting up field mappings: fm_order = arcpy.FieldMap() fieldmapping = arcpy.FieldMappings() fm_order.mergeRule = "First" print("Field mapping parameters set.") #if the fc uses full words, add the fc and "STREAM_ORDER" as an input field for fc in fullwords: fm_order.addInputField(fc, "STREAM_ORDER") #if the fc uses abbreviated words, add the fc and "STRMRDR" as an input field for fc in abbrev: fm_order.addInputField(fc, "STRMRDR") print("Input fields added.") #this is where it throws the error - trying to add streamorder as an output field streamorder = fm_order.outputField streamorder.name = "Stream_Order" fm_order.outputField = streamorder fieldmapping.addFieldMap(fm_order)
... View more