Error when overwriting feature layer

502
2
12-19-2021 10:52 AM
ErikaJimenez_Rivera1
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?

ErikaJimenez_Rivera1_0-1639939938846.png

 

 

*Update:

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.

ErikaJimenez_Rivera1_0-1639950353862.png

ErikaJimenez_Rivera1_1-1639950443324.png

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. 

ErikaJimenez_Rivera1_2-1639950504071.png

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!

thanks.

 

 

2 Replies
JiříKomínek
New Contributor III

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

0 Kudos
RyanGrammer21
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. 
 

Workaround:

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

1. Navigate to assistant.esri-ps.com 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
rgrammer@esri.com

THE SCIENCE OF WHERE ®
0 Kudos