In attempting to map input fields to output fields, I am finding that I cannot correctly assign the output field name. Running the script produces no errors, but for a given FieldMap object, the outputField property is assigned the name of the input field. I have mapped fields many times (though never with these specific tables) and never before encountered this problem.
Here is the code:
field_map = arcpy.FieldMappings() field_map.addTable(in_select) fm = arcpy.FieldMap() fm.addInputField(in_select, "CHANGE_STA") REPORT_STATUS = fm.outputField fm.outputField = REPORT_STATUS REPORT_STATUS.name = "REPORT_STATUS" REPORT_STATUS.type = "TEXT" field_map.addFieldMap(fm)
When I then call
fm.outputField.name, it returns the input field name
'CHANGE_STA' (and the append I run with this field map shows that it has not mapped the fields correctly)
Any ideas? What incredibly obvious thing am I missing? (Input table is a dbf table. Is this a problem with the table type?)