Select to view content in your preferred language

ArcGIS API for Python Append Does not Maintain Attachments

889
4
01-06-2023 12:00 PM
ZacharyNeumannQK
New Contributor II

The ArcGIS API for Python Append method does not maintain attachments when appending a hosted geodatabase to a hosted feature layer. I followed the steps from this tutorial:

https://www.esri.com/arcgis-blog/products/arcgis-online/data-management/keeping-layers-updated-by-ap...

My feature has no attachments. I double checked that when I downloaded the hosted filegeodatabase that the attachments were in there.

I do not see an option in Append method to maintain attachments.

0 Kudos
4 Replies
David_Brooks
MVP Regular Contributor

@ZacharyNeumannQK It's an environmental variable on the tool


David
..Maps with no limits..
0 Kudos
ZacharyNeumannQK
New Contributor II

No it's not. This is for the ArcGIS API for Python. This is not a "tool" in ArcGIS Pro. This is a python method used to append data to a hosted feature layer.

See reference here:

https://developers.arcgis.com/python/api-reference/arcgis.features.html#arcgis.features.FeatureLayer...

0 Kudos
RhettZufelt
MVP Notable Contributor

But, the tool has an arcpy option, and will work to append to hosted feature layers on AGOL using Pro/Python.

However it will NOT maintain Global ID's, so be carefull if these are needed. 

When appending to Hosted Feature Layer(s) in AGOL, from what I can tell, the python API append will preserve the Global ID's just fine, but does not support maintaining attachments.

The arcpy append maintains attachements just fine, but not Global ID's. 

So, as important as both of these are, it appears there is no built in way to maintain both attachments and Global ID's without overwriting the HFL itself.

Would hope this gets "fixed" in the future, but since ESRI lists this as a "Known Limitation", most likely will not get addressed.  Especially since this limitation was 'known' versions ago. 

R_ 

0 Kudos
ZacharyNeumannQK
New Contributor II

Thanks for the advice. I didn't know arcpy append worked on hosted feature layers but that makes sesne. I ended up using the API for Python and just manually appended the attachments using a table and the add attachments method. Seems to work fine.

0 Kudos