Attachments lost when appending

481
3
08-23-2022 12:09 AM
JosephHilliard94
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
RhettZufelt
MVP Frequent Contributor

I use arcpy.management.Append for this with 

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

 

and they append with attachments and all.

R_

0 Kudos
JosephHilliard94
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
KimOllivier
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