English

How To: Retain all attachments when combining feature classes containing attachments using the Append tool

Summary

In some instances, when feature classes containing attachments are merged together, the attachments are dropped and do not get carried over to the new merged feature class. The instructions provided below describe how feature classes with attachments can be merged together using the Append tool while successfully retaining all the attachments in the newly merged feature class.

Procedure

Note:
The instructions below are applicable for ArcGIS for Desktop 10.1 to 10.4. Starting from ArcGIS Desktop 10.5, the Maintain Attachments environment setting is introduced in the Append tool, which allows attachments to be copied when using the tool. For more information, refer to the following document: 10.5 version of the Append tool. 
  1. In ArcCatalog, copy both feature classes into the same geodatabase. Ensure the attachment tables and relationship classes for both feature classes are also copied.
Image of the Roads and Trails feature classes in the Zion geodatabase
  1. Open ArcMap, and load both feature classes and the attachment tables.
  2. In the attribute table of both feature classes, add a field named GID_SAVE. Set the type as Text with a length of 100.
  3. For both feature classes, start an edit session, and use the Field Calculator to populate the GID_SAVE field from the GlobalID field.
  4. Select one feature class and the corresponding attachment table of the selected feature class as the target to copy all the features from the other feature class. To do so, follow the steps provided below.
    1. From the Tools toolbar, click the Select Features Image of the Select Features icon icon, select all the features to be copied from the feature class to the target feature class, and click Copy.
    2. Remove the selection by clicking the Clear Selected Features Image of the Clear Selected Features icon icon.
    3. Right-click on the map > Paste.
    4. Select the target feature class in the Paste dialog box, and click OK.
Image of the Paste dialog box
  1. Click Save Edits, and end the edit session.
  2. Use the Append tool to append the attachment tables together. Use the selected attachment table from Step 5 for the Target Dataset and the other attachment table for the Input Datasets. Set the Schema Type to NO_TEST. Click OK, and let the tool run.
Image of the Append tool dialog box

Image of the appended table
  1. When the tables are appended to the selected target attachment table, right-click the table in the Table Of Contents > Joins and Relates > Join. Use the steps provided below to populate the fields in the Join Data dialog.
    1. From the first drop-down list for the Choose the field in this layer that the join will be based on option, select REL_GLOBALID.
    2. From the second drop-down list for the Choose the table to join this layer, or load the table from disk option, select the feature class that the features were copied to in Step 5.
    3. From the third drop-down list for the Choose the field in the table to base the join on option, select GID_SAVE.
    4. Under the Join Options header, select Keep all records, and click OK.
Image of the Join Data dialog box
Note:
The copied records are now tied back to their original attachments via the original GlobalID field.
  1. Start another edit session, and in the joined attachment table, use the Field Calculator to make the REL_GLOBALID field equal to the GLOBALID field from the joined feature class table for all records, using the following expression: REL_GLOBALID = [GLOBALID].
  2. Save the edits, and end the edit session. All the attachments are now successfully carried over to the joined feature class.
Note:
After Step 10, the GID_SAVE field can be removed from the feature classes, if desired, as the field is no longer required.

Related Information