Need help transferring photo attachments between layers.

2554
5
09-03-2020 11:38 AM
dlnrgmcgowan
New Contributor II

I'm trying to transfer several hundred photo attachments from one layer ('Layer 1') to another ('Layer 2'), but haven't been able to figure out how to do it automatically.  

All of the points in Layer 1 also exist in Layer 2, and many of the attributes remain unchanged.

 

I'm currently using AGOL and ArcGIS Pro 2.6.0 with an advanced license.

 

Any guidance would be greatly appreciated!

5 Replies
by Anonymous User
Not applicable

Hi dlnr gmcgowan‌,

Are both layers hosted feature layers? 

In this scenario I think you'll need to use Append in ArcGIS Pro one way or another, but there are couple approaches. For append, make sure the environment setting to maintain attachments is checked on. 

You mentioned that many of the attributes remain unchanged. If you append Layer 1 into Layer 2, then this will create new points that contain the attachments in Layer 2. However, if the attributes are the same you can then just delete the original point in Layer 2 and will have a point at that location, but with an attachment this time. 

Another option would be to download both layers as a file geodatabase from ArcGIS Online and open them as file geodatabase feature classes in ArcGIS Pro. This will expose the attachments table, and you can see behind the scenes how the attachments are connected to features via the GlobalID and rel_GlobalID fields. This relationship is what matches each photo to the feature in the database. With the attachment tables exposed, you can append layer 1's attachment table in to layer 2's attachment table, then edit the rel_GlobalIDs to point at Layer 2's GlobalIDs instead of Layer 1's. You're essentially copying the GlobalID from the point in Layer 2 that you want the attachment to be associated with:

Then pasting it into the rel_GlobalID field in the Attachments table:

Once the attachments are re-mapped to the points, then you can publish a new hosted feature layer. 

Something to note, there is currently an enhancement for the update data/append function in Manage hosted feature layers—ArcGIS Online Help | Documentation to include photo attachments. Let me know and I would be happy to attach your customer number to it. This would be a better option than the two workflows I mention above, and I hope we see it in the product soon. 

I hope this helps, 

-Peter 

Robbell1
New Contributor

Peter

Have come across this exact issue for hosted feature layers in ArcGIS Online, using the append tool does not keep the attachments. Found the BUG Page, but there is no status/comments as to when this may be fixed (and has not been updated in 2 years!!!) - are you able to provide any guidance?

Thanks

0 Kudos
angeliapayne
New Contributor

+1

 

Any solution or workaround for this topic???

0 Kudos
ErikAIversen
New Contributor II

Is there any update on this?

rwrenner_esri
Esri Contributor

You can use a scripting workflow to copy attachments from one feature layer to the other. Below is documentation to guide you through the workflow:

https://support.esri.com/en-us/knowledge-base/how-to-copy-attachments-from-one-feature-layer-to-anot...