Hi,
I'm seeking assistance to update my hosted feature layer titled "Stands_nd_statistics" using a zipped shapefile. My objective is to both update existing features with new data and add new features where necessary. I've attempted to achieve this using the append operation in ArcGIS Python API, but I encountered an Unknown Error with error code 500.
import arcpy, os, json, zipfile
from arcgis.gis import GIS
from arcgis import features
from arcgis.mapping import WebMap
from arcgis.features import FeatureLayerCollection
from arcgis.features import FeatureLayer
gis = GIS("https://www.arcgis.com", "username", "password")
search_result = gis.content.search("title:Stands_nd_statistics", item_type = "Feature Layer")
layer_item = search_result[0]
feature_layer = FeatureLayer(layer_item.url)
# Upload the zipped shapefile as an item to your GIS
zip_path = r"P:\Projects\Stands_nd_statistics.zip"
shapefile_item = gis.content.add({'title': 'Stands_nd_statistics_upload','type': 'Shapefile'}, data=zip_path)
feature_layer.append(item_id=shapefile_item.id, upload_format="shapefile", upsert=False)
Exception: Unknown Error
Any guidance or insights on how to troubleshoot and resolve this issue would be greatly appreciated! Thank you.