<?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: Update hosted feature service with a zip file, Unknown Error - error code: 500 in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-hosted-feature-service-with-a-zip-file/m-p/1496553#M10234</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/421884"&gt;@LienPham1&lt;/a&gt;&amp;nbsp;have you tried executing ArcGIS Pro's &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/append.htm" target="_self"&gt;Append&lt;/A&gt; tool?&amp;nbsp; This provides an &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/append.htm#:~:text=You%20can%20use%20this%20tool%20to%20insert%20new%20records%20and%20update%20existing%20records%20in%20a%20target%20dataset%20in%20the%20same%20operation%20(equivalent%20to%20an%20UPSERT%20database%20operation)." target="_self"&gt;upsert&lt;/A&gt; option which will&amp;nbsp;&lt;SPAN&gt;update existing features with new data and add new features.&amp;nbsp; To use the upsert option, make sure the field your using in the hosted feature service has a unique index:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JakeSkinner_0-1719227929898.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/107754iF76CC966A2C28FEE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JakeSkinner_0-1719227929898.png" alt="JakeSkinner_0-1719227929898.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jun 2024 11:19:07 GMT</pubDate>
    <dc:creator>JakeSkinner</dc:creator>
    <dc:date>2024-06-24T11:19:07Z</dc:date>
    <item>
      <title>Update hosted feature service with a zip file, Unknown Error - error code: 500</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-hosted-feature-service-with-a-zip-file/m-p/1495116#M10212</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm seeking assistance to update my hosted feature layer titled "Stands_nd_statistics" using a zipped shapefile. My objective is to both update existing features with new data and add new features where necessary. I've attempted to achieve this using the append operation in ArcGIS Python API, but I encountered an Unknown Error with error code 500.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;import arcpy, os, json,&amp;nbsp;&amp;nbsp;zipfile&lt;BR /&gt;from arcgis.gis import GIS&lt;BR /&gt;from arcgis import features&lt;BR /&gt;from arcgis.mapping import WebMap&lt;BR /&gt;from arcgis.features import FeatureLayerCollection&lt;BR /&gt;from arcgis.features import FeatureLayer&lt;/P&gt;&lt;P&gt;gis = GIS("&lt;A href="https://www.arcgis.com" target="_blank" rel="noopener"&gt;https://www.arcgis.com&lt;/A&gt;", "username", "password")&lt;/P&gt;&lt;P&gt;search_result = gis.content.search("title:Stands_nd_statistics", item_type = "Feature Layer")&lt;BR /&gt;layer_item = search_result[0]&lt;BR /&gt;feature_layer = FeatureLayer(layer_item.url)&lt;/P&gt;&lt;P&gt;# Upload the zipped shapefile as an item to your GIS&lt;BR /&gt;zip_path = r"P:\Projects\Stands_nd_statistics.zip"&lt;BR /&gt;shapefile_item = gis.content.add({'title': 'Stands_nd_statistics_upload','type': 'Shapefile'}, data=zip_path)&lt;/P&gt;&lt;P&gt;feature_layer.append(item_id=shapefile_item.id, upload_format="shapefile", upsert=False)&lt;/P&gt;&lt;P&gt;Exception: Unknown Error&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Any guidance or insights on how to troubleshoot and resolve this issue would be greatly appreciated! Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 21:49:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/update-hosted-feature-service-with-a-zip-file/m-p/1495116#M10212</guid>
      <dc:creator>LienPham1</dc:creator>
      <dc:date>2024-06-19T21:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: Update hosted feature service with a zip file, Unknown Error - error code: 500</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-hosted-feature-service-with-a-zip-file/m-p/1495119#M10213</link>
      <description>&lt;P&gt;I'm seeing the same type of error as I posted here :&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/after-3-3-upgrade-featurelayercollectionmanager/m-p/1481624#M10087" target="_blank"&gt;https://community.esri.com/t5/arcgis-api-for-python-questions/after-3-3-upgrade-featurelayercollectionmanager/m-p/1481624#M10087&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It looks like it could be a file size issue but I don't see anywhere in the updated documentation how to get around it.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 22:04:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/update-hosted-feature-service-with-a-zip-file/m-p/1495119#M10213</guid>
      <dc:creator>MichaelSnook</dc:creator>
      <dc:date>2024-06-19T22:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Update hosted feature service with a zip file, Unknown Error - error code: 500</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-hosted-feature-service-with-a-zip-file/m-p/1496008#M10223</link>
      <description>&lt;P&gt;Here's an idea. Load that shapefile into a spatial dataframe.&lt;/P&gt;&lt;PRE&gt;sdf = pd.DataFrame.spatial.from_featureclass(&lt;SPAN class=""&gt;"path\to\your\data\census_example\cities.shp"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then append like this instead:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;adds = sdf.spatial.to_featureset()
feature_layer.edit_features(adds=adds)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2024 15:36:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/update-hosted-feature-service-with-a-zip-file/m-p/1496008#M10223</guid>
      <dc:creator>EarlMedina</dc:creator>
      <dc:date>2024-06-21T15:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: Update hosted feature service with a zip file, Unknown Error - error code: 500</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-hosted-feature-service-with-a-zip-file/m-p/1496553#M10234</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/421884"&gt;@LienPham1&lt;/a&gt;&amp;nbsp;have you tried executing ArcGIS Pro's &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/append.htm" target="_self"&gt;Append&lt;/A&gt; tool?&amp;nbsp; This provides an &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/append.htm#:~:text=You%20can%20use%20this%20tool%20to%20insert%20new%20records%20and%20update%20existing%20records%20in%20a%20target%20dataset%20in%20the%20same%20operation%20(equivalent%20to%20an%20UPSERT%20database%20operation)." target="_self"&gt;upsert&lt;/A&gt; option which will&amp;nbsp;&lt;SPAN&gt;update existing features with new data and add new features.&amp;nbsp; To use the upsert option, make sure the field your using in the hosted feature service has a unique index:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JakeSkinner_0-1719227929898.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/107754iF76CC966A2C28FEE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JakeSkinner_0-1719227929898.png" alt="JakeSkinner_0-1719227929898.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 11:19:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/update-hosted-feature-service-with-a-zip-file/m-p/1496553#M10234</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2024-06-24T11:19:07Z</dc:date>
    </item>
  </channel>
</rss>

