Attachments lost when appending

08-23-2022 12:09 AM
New Contributor III

Hi there,

When using the .append () method on a geodatabase (uploaded to AGOL) to a hosted feature layer, the attachments don't carry across to the hosted feature layer. Any ideas? 

Tags (2)
0 Kudos
3 Replies
MVP Frequent Contributor

I use for this with 

arcpy.env.maintainAttachments = True
arcpy.env.preserveGlobalIds = True


and they append with attachments and all.


0 Kudos
New Contributor III

I cannot use ArcPy for this task sadly. Needs to be with the ArcGIS API for Python append method, thanks though!

0 Kudos
Occasional Contributor III

The GlobalID is readonly and out of our control. Make a new field and save the ID to a new GUID field that you do have ownership. Then make up a dictionary of oldID to newID and change the foreign key in the attachment to point to the new one. Phew!

0 Kudos