AnsweredAssumed Answered

How to append two FC  one with additional fields  in Python

Question asked by jsn on Jun 1, 2020
Latest reply on Jun 1, 2020 by danretired

Good afternoon,

 

I am writing a scripts that  appends records  in several FC and some of them have additional fields because the schema was  modified.

 

Can I use this kind of Python script with "NO_TEST"  when  I copy the same FC but the new version has more fields than the old one ?

 

 

taget_layer is the new version of source_layer but in several cases it has additional fields.

 

fieldmappings = arcpy.FieldMappings()

#Like when you manually choose a layer in the toolbox and it adds the fields to grid
fieldmappings.addTable(target_layer)
fieldmappings.addTable(append_layer)


arcpy.Append_management(append_laye, target_layer, 'NO_TEST', ffieldmappings)

 

Thanks

Outcomes