HOW TO
In ArcGIS Pro, the Append tool can be used to add additional data to an existing target dataset. However, when there are features with identical locations in both the input and target datasets, running the Append tool generates duplicate features in the target dataset. It is sometimes necessary to delete duplicate features to retain only one entry per feature in the attribute table.
This article provides two workarounds to remove the older records of duplicate features from the target dataset, and only retain the newest records after running the Append tool.
Depending on the usage, follow one of the workarounds below to solve the issue.
Use the Dissolve tool
Note: The result of this workaround is populated in a new feature class.
Note: Skip Step 1 if the appended dataset has an existing field with identical values that can be used to identify the duplicate data. Ensure there are no inconsistencies between the identical values. For example, 'StreetNameA' and 'StreetName_A' are not considered identical values for this workflow.
Use a custom Python script
Note: Follow this workaround to modify the appended dataset without creating a new feature class.
When new features are appended to the target dataset, the appended features are automatically assigned a new Object ID each in sequential order following the existing data; the larger an Object ID number, the more recent a feature is added to the dataset. Therefore, the Object ID field can be used as the field to sort for the latest record by selecting the feature with the largest Object ID value among duplicate features.
Note: Depending on the datasets used, the Object IDs are maintained in either the OBJECTID field or the OBJECTID_1 field. To identify the field storing the Object IDs, hover over the field header in the attribute table. The data type of the field storing the Object IDs is 'Object ID'. Refer to ArcMap: When is an ObjectID added to a table? for more information.![]()
import arcpy
fc = r"<feature class path>" id = "<field name>" sort_field = "<field name> D"
cursor = arcpy.UpdateCursor(fc,"","",id,sort_field) keepList = list() for row in cursor: row_val = row.getValue(id) if row_val not in keepList: keepList.append(row_val) elif row_val in keepList: cursor.deleteRow(row) else: pass
The following shows an example of the full script.
import arcpy fc = r"C:\Users\User\Documents\ArcGIS\Projects\Append\Append.gdb\DataMain" id = "Coordinate" sort_field = "OBJECTID D" cursor = arcpy.UpdateCursor(fc,"","",id,sort_field) keepList = list() for row in cursor: row_val = row.getValue(id) if row_val not in keepList: keepList.append(row_val) elif row_val in keepList: cursor.deleteRow(row) else: pass
Article ID: 000028108
Get help from ArcGIS experts
Download the Esri Support App