<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to overwrite existing Feature Layer (hosted)  with python script in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/how-to-overwrite-existing-feature-layer-hosted/m-p/1181751#M46389</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Within my organization I have "&lt;SPAN&gt;Feature Layer (hosted)" - I exported it from point feature class in ArcGIS Pro. This layer has about 250 points. I want to update them, add new points, remove others. I have some web maps appended to it and web apps, so I need to overwrite it (or update if it is better option).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am wondering, how can I do it with python code? What is the workflow with this kind of updates? Why I cannot edit the Feature Layer (hosted) at all in ArcGIS Pro? Can you help me with sample code for this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS. I tried this article:&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/samples/overwriting-feature-layers/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/python/samples/overwriting-feature-layers/&lt;/A&gt;&amp;nbsp;(here is csv instead of feature class as input), and I got 'success' response after this code for my feature layer:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;from&lt;/SPAN&gt; &lt;SPAN class=""&gt;arcgis.features&lt;/SPAN&gt; &lt;SPAN class=""&gt;import&lt;/SPAN&gt; &lt;SPAN class=""&gt;FeatureLayerCollection&lt;/SPAN&gt;
&lt;SPAN class=""&gt;cities_flayer_collection&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;FeatureLayerCollection&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;fromitem&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;cities_item&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;#call the overwrite() method which can be accessed using the manager property&lt;/SPAN&gt;
&lt;SPAN class=""&gt;cities_flayer_collection&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;manager&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;overwrite&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;os&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;path&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;join&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;'data'&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;'updating_gis_content'&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;
                               &lt;SPAN class=""&gt;'updated_capitals_csv'&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;'capitals_1.csv'&lt;/SPAN&gt;&lt;SPAN class=""&gt;))&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;but the layer is not overwritten anyway...&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jun 2022 09:44:20 GMT</pubDate>
    <dc:creator>LukaszKowalski2013</dc:creator>
    <dc:date>2022-06-10T09:44:20Z</dc:date>
    <item>
      <title>How to overwrite existing Feature Layer (hosted)  with python script</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-overwrite-existing-feature-layer-hosted/m-p/1181751#M46389</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Within my organization I have "&lt;SPAN&gt;Feature Layer (hosted)" - I exported it from point feature class in ArcGIS Pro. This layer has about 250 points. I want to update them, add new points, remove others. I have some web maps appended to it and web apps, so I need to overwrite it (or update if it is better option).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am wondering, how can I do it with python code? What is the workflow with this kind of updates? Why I cannot edit the Feature Layer (hosted) at all in ArcGIS Pro? Can you help me with sample code for this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS. I tried this article:&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/samples/overwriting-feature-layers/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/python/samples/overwriting-feature-layers/&lt;/A&gt;&amp;nbsp;(here is csv instead of feature class as input), and I got 'success' response after this code for my feature layer:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;from&lt;/SPAN&gt; &lt;SPAN class=""&gt;arcgis.features&lt;/SPAN&gt; &lt;SPAN class=""&gt;import&lt;/SPAN&gt; &lt;SPAN class=""&gt;FeatureLayerCollection&lt;/SPAN&gt;
&lt;SPAN class=""&gt;cities_flayer_collection&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;FeatureLayerCollection&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;fromitem&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;cities_item&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;#call the overwrite() method which can be accessed using the manager property&lt;/SPAN&gt;
&lt;SPAN class=""&gt;cities_flayer_collection&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;manager&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;overwrite&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;os&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;path&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;join&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;'data'&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;'updating_gis_content'&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;
                               &lt;SPAN class=""&gt;'updated_capitals_csv'&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;'capitals_1.csv'&lt;/SPAN&gt;&lt;SPAN class=""&gt;))&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;but the layer is not overwritten anyway...&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 09:44:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-overwrite-existing-feature-layer-hosted/m-p/1181751#M46389</guid>
      <dc:creator>LukaszKowalski2013</dc:creator>
      <dc:date>2022-06-10T09:44:20Z</dc:date>
    </item>
  </channel>
</rss>

