I have a feature layer that I'm trying to update regularly with new data using the ArcGIS Online Python API.
The two methods I've found in ESRI docs are to create a featurelayer collection and use overwrite() or to use the Truncate and Append method.
The overwwrite() method doesn't change any of the data but says the operation is successful, so there's no indication why it hasn't worked.
The truncate and append method fails at calling append() with an unspecified 500 error.
I would love to know what the officially supported way to overwrite an existing layer on AGOL is, either from a spatially-enabled data frame or from a layer in a file geodatabase.
Solved! Go to Solution.
Truncate and append is the method to use. Overwriting a feature service has historically led to problems.
Don't use the literal append() method, either. If you've got a spatial dataframe, you can just do
FeatureLayer.edit_features(adds=spatial_dataframe.spatial.to_featureset())
Truncate and append is the method to use. Overwriting a feature service has historically led to problems.
Don't use the literal append() method, either. If you've got a spatial dataframe, you can just do
FeatureLayer.edit_features(adds=spatial_dataframe.spatial.to_featureset())
Looks like `edit_features()` does what I need so I'll go ahead with that. Thanks for the info!