<?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 Re: Error attempting to overwrite feature layer data using Python API in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/error-attempting-to-overwrite-feature-layer-data/m-p/1222058#M48345</link>
    <description>&lt;P&gt;No, the orginal file GDB is in my content.&amp;nbsp; I uploaded this first as a zip file with the option to publish a hosted feature layer.&amp;nbsp; Beyond that there is no SD.&amp;nbsp; I can successfully update the newly created feature layer with an updated file GDB (zipped) using the AGO tools but it just doesn't work with the script.&lt;/P&gt;</description>
    <pubDate>Fri, 14 Oct 2022 14:49:42 GMT</pubDate>
    <dc:creator>MichaelSnook</dc:creator>
    <dc:date>2022-10-14T14:49:42Z</dc:date>
    <item>
      <title>Error attempting to overwrite feature layer data using Python API</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-attempting-to-overwrite-feature-layer-data/m-p/1222006#M48341</link>
      <description>&lt;P&gt;I cannot seem to overwrite a feature layer by uploading a file geodatabase via the Python API. I have triple checked and re-tried from start to finish uploading a .zipped file GDB, publishing a hosted feature service and attempt to update the file GDB with the EXACT SAME name as when I started. I throws the 'Cannot find related data item used to publish this Feature Layer' error. It works fine however if I use the tools in ArcGIS online, navigate to the same file GDB and overwrite.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    gis = GIS(baseurl, username, password, verify_cert=False)&lt;BR /&gt;    gdbpath = r"c:\temp\gdb.zip'
    item = gis.content.get('guid') # feature layer collection
    fs = item.layers[0].container

    print(fs.manager.overwrite(gdbpath))`&lt;/PRE&gt;&lt;P&gt;I have to think there's something with how you enter the path to the gdb for it to recongnize it as the same file name. Any ideas? Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 13:17:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-attempting-to-overwrite-feature-layer-data/m-p/1222006#M48341</guid>
      <dc:creator>MichaelSnook</dc:creator>
      <dc:date>2022-10-14T13:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: Error attempting to overwrite feature layer data using Python API</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-attempting-to-overwrite-feature-layer-data/m-p/1222027#M48342</link>
      <description>&lt;P&gt;I've recently been doing this with geojson. I found that the feature layer collection itself was updated rather than the&lt;/P&gt;&lt;LI-CODE lang="python"&gt;item.layers[0].container&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So with your code this would be:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;gdbpath = r"c:\temp\gdb.zip'
item = gis.content.get('guid') # this is just the item
feature_layer_collection = FeatureLayerCollection.fromitem(item)
feature_layer_collection.manager.overwrite(gdbpath)

&lt;/LI-CODE&gt;&lt;P&gt;It may be different as you are dealing with a gdb here instead of geojson.&lt;/P&gt;&lt;P&gt;There's a sample of overwriting features in the API samples &lt;A href="https://developers.arcgis.com/python/samples/overwriting-feature-layers/" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 13:50:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-attempting-to-overwrite-feature-layer-data/m-p/1222027#M48342</guid>
      <dc:creator>Oliver_Burdekin</dc:creator>
      <dc:date>2022-10-14T13:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Error attempting to overwrite feature layer data using Python API</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-attempting-to-overwrite-feature-layer-data/m-p/1222045#M48343</link>
      <description>&lt;P&gt;I have tried that previously with the same results...either way the .container property or the .fromitem method return the FeatureLayerCollection...which is what is needed to access the .manager.&amp;nbsp; Both ways, when calling the .overwrite method with the file path, fail with the '&lt;SPAN&gt;Cannot find related data item used to publish this Feature Layer' error. I'm stumped.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 14:23:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-attempting-to-overwrite-feature-layer-data/m-p/1222045#M48343</guid>
      <dc:creator>MichaelSnook</dc:creator>
      <dc:date>2022-10-14T14:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Error attempting to overwrite feature layer data using Python API</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-attempting-to-overwrite-feature-layer-data/m-p/1222049#M48344</link>
      <description>&lt;P&gt;Is there a service definition associated with the fgbd?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 14:28:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-attempting-to-overwrite-feature-layer-data/m-p/1222049#M48344</guid>
      <dc:creator>Oliver_Burdekin</dc:creator>
      <dc:date>2022-10-14T14:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: Error attempting to overwrite feature layer data using Python API</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-attempting-to-overwrite-feature-layer-data/m-p/1222058#M48345</link>
      <description>&lt;P&gt;No, the orginal file GDB is in my content.&amp;nbsp; I uploaded this first as a zip file with the option to publish a hosted feature layer.&amp;nbsp; Beyond that there is no SD.&amp;nbsp; I can successfully update the newly created feature layer with an updated file GDB (zipped) using the AGO tools but it just doesn't work with the script.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 14:49:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-attempting-to-overwrite-feature-layer-data/m-p/1222058#M48345</guid>
      <dc:creator>MichaelSnook</dc:creator>
      <dc:date>2022-10-14T14:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Error attempting to overwrite feature layer data using Python API</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-attempting-to-overwrite-feature-layer-data/m-p/1222343#M48357</link>
      <description>&lt;P&gt;I finally figured it out...it's not exactly obvious but it was staring me in the face.&amp;nbsp; The owner of the orginal dataset was a different user than the one connecting to AGO in the script.&amp;nbsp; Once I changed ownership to the connecting user it works fine!&lt;/P&gt;&lt;P&gt;Now, we use a data-admin user that has similar prvilages to a adminstrator but trimmed down a bit for these data managment task automations.&amp;nbsp; I would assume that this user would be able to find the original datasource (that another user owns) for the feature layer and replace it but it doesn't seem like that's the case.&lt;/P&gt;&lt;P&gt;I wonder if there is a setting that would allow this or if that's just how it is?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 12:59:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-attempting-to-overwrite-feature-layer-data/m-p/1222343#M48357</guid>
      <dc:creator>MichaelSnook</dc:creator>
      <dc:date>2022-10-24T12:59:36Z</dc:date>
    </item>
  </channel>
</rss>

