Error when overwriting feature layer

12-19-2021 10:52 AM
New Contributor II

According to the documentation, there is a paramater (context) in the tool arcgis.features.analysis.join_features. In  this parameter, there is an option to overwrite an existing feature layer.

It is a dictionary, and I am writing it like that. However, I still get an error, saying the name already exist. Which I thought would be solved by enabling the overwrite. 

Am I writing it wrong? or is there a mistake in my code?





So, I realized that maybe I needed to call the layer to be overwritten per se. which I just did at the beggining of the code.



And it finally works! The error does not appear anymore.

HOWEVER, when reviewing the feature layer I notice that it is adding more layers instead of overwriting the existing layer. 


This service is going to be updated regularly, so I don´t want to accumulate layers. 

So, that was the update. Any suggestions or recommendations are more than welcome!




2 Replies
New Contributor III

Hi, did you find solution? I have the same problem.

0 Kudos
Esri Contributor

Hi @ErikaJimenez_Rivera1 

Here is a workaround you can try until the issue is resolved. You will have to manually complete this workflow (could do it weekly, biweekly, etc), however it solves the problem that you are experiencing. 


Use ArcGIS Online Assistant to remove sublayers from feature layer. NOTE: ArcGIS Online Assistant is not supported by Esri Technical Support.

1. Navigate to and Log In.

2. Under "My Content", find the target feature layer and click it. Click "View Item JSON".

3. Click on the "Data Tab". Click "Edit JSON".

4. Delete the duplicate json data. Be sure to keep the original ("id": 0). Deleting it all will break the layer and any dependent apps.

Hope this helps!

Ryan Grammer | ArcGIS Support Analyst
Esri | 380 New York St | Redlands, CA 92373 | USA

0 Kudos