<?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 trying to overwrite CSV  file in add item properties in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-trying-to-overwrite-csv-file-in-add-item/m-p/1215598#M7802</link>
    <description>&lt;P&gt;Oh!!!! Don't do it this way. Go through Hub. If you share the feature layer as a view w/ hub and turn on the export options, the CSV is automatically handled.&lt;/P&gt;&lt;P&gt;&lt;A href="https://data.bellevuewa.gov" target="_blank"&gt;https://data.bellevuewa.gov&lt;/A&gt;&amp;nbsp;as an example only has services published daily and the CSV, Shapefiles, etc are all auto generated on demand.&lt;/P&gt;</description>
    <pubDate>Fri, 23 Sep 2022 16:44:33 GMT</pubDate>
    <dc:creator>John_Spence</dc:creator>
    <dc:date>2022-09-23T16:44:33Z</dc:date>
    <item>
      <title>Error trying to overwrite CSV  file in add item properties</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-trying-to-overwrite-csv-file-in-add-item/m-p/1215542#M7794</link>
      <description>&lt;P&gt;I'm trying to overwrite an existing CSV at 15 minute intervals w/ a notebook in AGOL. In the add() method I have the key:value Argument item_properties option set to True for overwrite.&lt;/P&gt;&lt;P&gt;&amp;nbsp;I, however continuously get an error telling me the file already exists:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# add the item to AGOL as csv
projectIdeasTable = gis.content.add(item_properties = {"type": "CSV",
                                   "title": "Project Ideas Table",
                                   "summary": "Table of public project ideas for download as part of particpatory budgeting process",
                                   "snippet": "Intended use for users who have trouble reading content in maps or other forms",
                                   "tags": "participatory budgeting",
                                   "access": "public",
                                   "overwrite": True,          
                                    }, data = 'ProjectIdeas.csv')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;Exception&lt;/SPAN&gt;: Item 'ProjectIdeas.csv' already exists.
(Error Code: 409)&lt;/PRE&gt;&lt;P&gt;This seems like a simple issues that shouldn't throw this error. Thoughts?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 15:39:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-trying-to-overwrite-csv-file-in-add-item/m-p/1215542#M7794</guid>
      <dc:creator>ZacharyStanley</dc:creator>
      <dc:date>2022-09-23T15:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Error trying to overwrite CSV  file in add item properties</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-trying-to-overwrite-csv-file-in-add-item/m-p/1215563#M7798</link>
      <description>&lt;P&gt;Would it be better to use the &lt;STRONG&gt;arcgis.gis.Item.update()&lt;/STRONG&gt; instead? That should specifically allow you to update the content of the given item in-place, rather than attempt to add a "new" item.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 16:01:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-trying-to-overwrite-csv-file-in-add-item/m-p/1215563#M7798</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-09-23T16:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Error trying to overwrite CSV  file in add item properties</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-trying-to-overwrite-csv-file-in-add-item/m-p/1215568#M7800</link>
      <description>&lt;LI-CODE lang="python"&gt;        # Find Item
        search_result= connectedP.content.search(serviceID, 'Feature Layer')
        FS_item = search_result[0]

        targetedOverwrite = FeatureLayerCollection.fromitem(FS_item)

        time.sleep(90)

        fileTransfer = r'{}\{}'.format(path_Proj, fileName)
        print ('Updating {} using {}'.format(FS_item.title, fileName))

        # Send for update
        try:
            targetedOverwrite.manager.overwrite(fileTransfer)
            print ('\tSuccessful update of {} \r\r'.format(FS_item.title))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Frankly though, I would not do it this way (recommend) and would likely look at directly accessing the data source or scraping the CSV to a database where you add/remove/update records and then publish/update the service either via writing to the service (depending on record account that might be the most efficient way) or by overwriting the service.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;        # Share to portal
        print('     ...Uploading Service Definition')
        arcpy.UploadServiceDefinition_server(inSdFile, inServer, inServiceName, inCluster, inFolderType, inFolder,
                                             inStartup, inOverride, inMyContents, inPublic, inOrganization, inGroups)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 23 Sep 2022 16:06:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-trying-to-overwrite-csv-file-in-add-item/m-p/1215568#M7800</guid>
      <dc:creator>John_Spence</dc:creator>
      <dc:date>2022-09-23T16:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Error trying to overwrite CSV  file in add item properties</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-trying-to-overwrite-csv-file-in-add-item/m-p/1215596#M7801</link>
      <description>&lt;P&gt;The problem is I have to collect data from a feature layer that is turned on for public data collection. The CSV needs to be overwritten with data from the updated feature layer. The CSV will ultimately be shared publicly for downloaded for people with disabilities.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 16:41:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-trying-to-overwrite-csv-file-in-add-item/m-p/1215596#M7801</guid>
      <dc:creator>ZacharyStanley</dc:creator>
      <dc:date>2022-09-23T16:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: Error trying to overwrite CSV  file in add item properties</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-trying-to-overwrite-csv-file-in-add-item/m-p/1215598#M7802</link>
      <description>&lt;P&gt;Oh!!!! Don't do it this way. Go through Hub. If you share the feature layer as a view w/ hub and turn on the export options, the CSV is automatically handled.&lt;/P&gt;&lt;P&gt;&lt;A href="https://data.bellevuewa.gov" target="_blank"&gt;https://data.bellevuewa.gov&lt;/A&gt;&amp;nbsp;as an example only has services published daily and the CSV, Shapefiles, etc are all auto generated on demand.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 16:44:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-trying-to-overwrite-csv-file-in-add-item/m-p/1215598#M7802</guid>
      <dc:creator>John_Spence</dc:creator>
      <dc:date>2022-09-23T16:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: Error trying to overwrite CSV  file in add item properties</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-trying-to-overwrite-csv-file-in-add-item/m-p/1215602#M7803</link>
      <description>&lt;P&gt;I will explore this solution - thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 17:06:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-trying-to-overwrite-csv-file-in-add-item/m-p/1215602#M7803</guid>
      <dc:creator>ZacharyStanley</dc:creator>
      <dc:date>2022-09-23T17:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: Error trying to overwrite CSV  file in add item properties</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-trying-to-overwrite-csv-file-in-add-item/m-p/1215604#M7804</link>
      <description>&lt;P&gt;Reach out if you run into any issues. We would be happy to give some pointers we learned along the way.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 17:08:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-trying-to-overwrite-csv-file-in-add-item/m-p/1215604#M7804</guid>
      <dc:creator>John_Spence</dc:creator>
      <dc:date>2022-09-23T17:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: Error trying to overwrite CSV  file in add item properties</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-trying-to-overwrite-csv-file-in-add-item/m-p/1215613#M7805</link>
      <description>&lt;P&gt;Thanks! The real challenge we run into with this approach is disabled folks ability to get to the location to actually download the data. We have a hub site with an embedded web app and will link directly to the CSV below this app.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 17:20:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-trying-to-overwrite-csv-file-in-add-item/m-p/1215613#M7805</guid>
      <dc:creator>ZacharyStanley</dc:creator>
      <dc:date>2022-09-23T17:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Error trying to overwrite CSV  file in add item properties</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-trying-to-overwrite-csv-file-in-add-item/m-p/1215622#M7806</link>
      <description>&lt;P&gt;What we did to overcome this, was to put a link to the dataset (&lt;A href="https://data.bellevuewa.gov/datasets/cobgis::regional-power-outages-current/explore?layer=0&amp;amp;location=47.855603%2C-122.513551%2C9.84" target="_blank"&gt;https://data.bellevuewa.gov/datasets/cobgis::regional-power-outages-current/explore?layer=0&amp;amp;location=47.855603%2C-122.513551%2C9.84&lt;/A&gt;) and the download button is prominently displayed along with the information about the dataset. Our HR folks have people with disabilities on staff so we were able to test a wide variety of conditions to see if that would work. The biggest issue we all have though with the Esri online products, especially embedding (iframes) is that sometimes the screen readers do not exactly work well.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 17:34:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-trying-to-overwrite-csv-file-in-add-item/m-p/1215622#M7806</guid>
      <dc:creator>John_Spence</dc:creator>
      <dc:date>2022-09-23T17:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: Error trying to overwrite CSV  file in add item properties</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-trying-to-overwrite-csv-file-in-add-item/m-p/1215651#M7808</link>
      <description>&lt;P&gt;Yeah, we have to test everything on screen readers to meet our accessibility standards. Thanks for all the help.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 18:01:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-trying-to-overwrite-csv-file-in-add-item/m-p/1215651#M7808</guid>
      <dc:creator>ZacharyStanley</dc:creator>
      <dc:date>2022-09-23T18:01:28Z</dc:date>
    </item>
  </channel>
</rss>

