How To: Retain all attachments when merging hosted feature layers
Managing hosted feature layers in ArcGIS Online may require features and attachments to be appended to another hosted feature layer. However, when hosted feature layers with attachments are merged using the Merge Layers tool in ArcGIS Online, the attachments are dropped.
To avoid this issue, use the Merge or Append tool in Pro or ArcMap instead. These desktop tools can merge the features with the attachments in the hosted feature layers into one hosted feature layer. Beginning with ArcMap 10.5 and ArcGIS Pro 2.0, an environment setting for Maintain Attachments is available, which can be used to copy attachments from input features to output features.
The image below is an example of attributes with attachments in a hosted feature layer that must be merged with another hosted feature layer and retain all attachments.
The instructions below describe how to successfully merge hosted feature layers with attachments using the Append tool in ArcMap. When working in ArcMap, hosted feature layers cannot be used as direct input and output for geoprocessing tools. Therefore, the ArcMap workflow requires creating a local copy of the hosted feature layers.
If working with these tools in ArcGIS Pro, hosted feature layers can be used as direct input and output, eliminating the need to make a local copy of the data and republish to a hosted feature layer.
The Append tool appends input datasets into a target dataset. It is important to identify which hosted feature layer is the input dataset and which one is the target dataset before merging the hosted feature layers.
In ArcGIS Online, export the hosted feature layer (input dataset) containing the data to append to the target hosted feature layer (target dataset). Use the Export to FGDB option, and download the exported file geodatabase.
In the hosted feature layer Item Details page, click Export Data > Export to FGDB.
In the Export to File Geodatabase window, provide the title, tags, and summary for the file geodatabase. Specify the folder to save the file geodatabase, and click Export.
When the exporting process is complete, click Download to download the file geodatabase. The downloaded file geodatabase contains the feature class with the associated attachments.
The feature class in the downloaded file geodatabase is used as input for the Append tool in subsequent steps. All features and attachments from this feature layer are appended to a target feature layer.