I'm writing a process to append data from one table to a new one with a different schema and so need to used field mappings to associate an input field to the output field where the field names are not equivalent. Reading through the help guides on field mappings I am seeing this approach and I'm not sure why this is being done. This code seems circular, first setting a variable equal to an object, setting some attributes of the object and then reassigning the object back to itself? Anyone have an explanation to help me understand what is being accomplished here?
These lines of code are from this help article:
FieldMap help
diam_name = fm_diam.outputField
diam_name.name = 'Veg_Diam'
fm_diam.outputField = diam_name
I really wish there was an easier way to achieve this, the fieldmap/fieldmappings approach seems really arcane.