<?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: Key Error when publishing shapefile into feature layer in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/key-error-when-publishing-shapefile-into-feature/m-p/1008632#M5304</link>
    <description>&lt;P&gt;Since my error was dealing with the default parameters being recognized correctly, I instead typed out the parameters which I found here (&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.Item.publish" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.Item.publish&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;Hence I used the code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Publish the shapefile item into a feature layer&lt;BR /&gt;Applications_item = stapefile_item.publish(publish_parameters=None, address_fields=None, output_type=None, overwrite=False, file_type=None, build_initial_cache=False)&lt;BR /&gt;Applications_item&lt;/P&gt;&lt;P&gt;*I thought this was a solution but it did not&lt;/P&gt;</description>
    <pubDate>Thu, 10 Dec 2020 23:44:51 GMT</pubDate>
    <dc:creator>SharitaU</dc:creator>
    <dc:date>2020-12-10T23:44:51Z</dc:date>
    <item>
      <title>Key Error when publishing shapefile into feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/key-error-when-publishing-shapefile-into-feature/m-p/1008480#M5301</link>
      <description>&lt;P&gt;Greetings all,&lt;/P&gt;&lt;P&gt;I followed the workflow as shown on the follow page (&lt;A href="https://developers.arcgis.com/python/sample-notebooks/overwriting-feature-layers/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/python/sample-notebooks/overwriting-feature-layers/&lt;/A&gt;) and am receive a key error when attempting to publish my shapefile into a feature layer.&amp;nbsp; My code used to work fine and started throwing an error after no changes were made. My code and error are found below&lt;/P&gt;&lt;P&gt;#Add the shapefile as an item (which publishes perfectly fine)&lt;/P&gt;&lt;P&gt;item_prop = {'title': '2021 NPU Applications', 'tags': 'GIS', 'type':'Shapefile'}&lt;BR /&gt;shapefile_item = gis.content.add(item_properties=item_prop, data=my_shapefile)&lt;BR /&gt;shapefile_item&lt;/P&gt;&lt;P&gt;#Publish the shapefile item into a feature layer (which throws an error)&lt;BR /&gt;Applications_item = shapefile_item.publish()&lt;BR /&gt;Applications_item&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="ansi-red-intense-fg ansi-bold"&gt;---------------------------------------------------------------------------&lt;/SPAN&gt;
&lt;SPAN class="ansi-red-intense-fg ansi-bold"&gt;KeyError&lt;/SPAN&gt;                                  Traceback (most recent call last)
&lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;&amp;lt;ipython-input-24-2d2a4fbd26be&amp;gt;&lt;/SPAN&gt; in &lt;SPAN class="ansi-cyan-fg"&gt;&amp;lt;module&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="ansi-green-fg"&gt;      1&lt;/SPAN&gt; &lt;SPAN class="ansi-red-intense-fg ansi-bold"&gt;#Publish the shapefile item into a feature layer&lt;/SPAN&gt;
&lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;----&amp;gt; 2&lt;/SPAN&gt; Applications_item &lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;=&lt;/SPAN&gt; shapefile_item&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;.&lt;/SPAN&gt;publish&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;(&lt;/SPAN&gt;&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="ansi-green-fg"&gt;      3&lt;/SPAN&gt; Applications_item

&lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py&lt;/SPAN&gt; in &lt;SPAN class="ansi-cyan-fg"&gt;publish&lt;/SPAN&gt;&lt;SPAN class="ansi-blue-intense-fg ansi-bold"&gt;(self, publish_parameters, address_fields, output_type, overwrite, file_type, build_initial_cache)&lt;/SPAN&gt;
&lt;SPAN class="ansi-green-fg"&gt;   8860&lt;/SPAN&gt;         &lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;elif&lt;/SPAN&gt; &lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;not&lt;/SPAN&gt; buildInitialCache &lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;and&lt;/SPAN&gt; output_type &lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;is&lt;/SPAN&gt; &lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;not&lt;/SPAN&gt; &lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;None&lt;/SPAN&gt; &lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;and&lt;/SPAN&gt; output_type&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;.&lt;/SPAN&gt;lower&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;(&lt;/SPAN&gt;&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;)&lt;/SPAN&gt; &lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;in&lt;/SPAN&gt; &lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;[&lt;/SPAN&gt;&lt;SPAN class="ansi-blue-intense-fg ansi-bold"&gt;'sceneservice'&lt;/SPAN&gt;&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;]&lt;/SPAN&gt;&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;:&lt;/SPAN&gt;
&lt;SPAN class="ansi-green-fg"&gt;   8861&lt;/SPAN&gt;             &lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;return&lt;/SPAN&gt; Item&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;(&lt;/SPAN&gt;self&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;.&lt;/SPAN&gt;_gis&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;,&lt;/SPAN&gt; ret&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;[&lt;/SPAN&gt;&lt;SPAN class="ansi-cyan-intense-fg ansi-bold"&gt;0&lt;/SPAN&gt;&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;]&lt;/SPAN&gt;&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;[&lt;/SPAN&gt;&lt;SPAN class="ansi-blue-intense-fg ansi-bold"&gt;'serviceItemId'&lt;/SPAN&gt;&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;]&lt;/SPAN&gt;&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;-&amp;gt; 8862&lt;/SPAN&gt;         &lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;elif&lt;/SPAN&gt; &lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;not&lt;/SPAN&gt; buildInitialCache &lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;and&lt;/SPAN&gt; ret&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;[&lt;/SPAN&gt;&lt;SPAN class="ansi-cyan-intense-fg ansi-bold"&gt;0&lt;/SPAN&gt;&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;]&lt;/SPAN&gt;&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;[&lt;/SPAN&gt;&lt;SPAN class="ansi-blue-intense-fg ansi-bold"&gt;'type'&lt;/SPAN&gt;&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;]&lt;/SPAN&gt;&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;.&lt;/SPAN&gt;lower&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;(&lt;/SPAN&gt;&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;)&lt;/SPAN&gt; &lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;==&lt;/SPAN&gt; &lt;SPAN class="ansi-blue-intense-fg ansi-bold"&gt;'image service'&lt;/SPAN&gt;&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;:&lt;/SPAN&gt;
&lt;SPAN class="ansi-green-fg"&gt;   8863&lt;/SPAN&gt;             &lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;return&lt;/SPAN&gt; Item&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;(&lt;/SPAN&gt;self&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;.&lt;/SPAN&gt;_gis&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;,&lt;/SPAN&gt; ret&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;[&lt;/SPAN&gt;&lt;SPAN class="ansi-cyan-intense-fg ansi-bold"&gt;0&lt;/SPAN&gt;&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;]&lt;/SPAN&gt;&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;[&lt;/SPAN&gt;&lt;SPAN class="ansi-blue-intense-fg ansi-bold"&gt;'serviceItemId'&lt;/SPAN&gt;&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;]&lt;/SPAN&gt;&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="ansi-green-fg"&gt;   8864&lt;/SPAN&gt;         &lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;else&lt;/SPAN&gt;&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;:&lt;/SPAN&gt;

&lt;SPAN class="ansi-red-intense-fg ansi-bold"&gt;KeyError&lt;/SPAN&gt;: 'type'&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 14:57:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/key-error-when-publishing-shapefile-into-feature/m-p/1008480#M5301</guid>
      <dc:creator>SharitaU</dc:creator>
      <dc:date>2020-12-10T14:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: Key Error when publishing shapefile into feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/key-error-when-publishing-shapefile-into-feature/m-p/1008498#M5302</link>
      <description>&lt;P&gt;Moving this to the api for python questions community&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-api-for-python/ct-p/arcgis-api-for-python" target="_blank"&gt;ArcGIS API for Python - GeoNet, The Esri Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 15:37:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/key-error-when-publishing-shapefile-into-feature/m-p/1008498#M5302</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-12-10T15:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Key Error when publishing shapefile into feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/key-error-when-publishing-shapefile-into-feature/m-p/1008515#M5303</link>
      <description>&lt;P&gt;Thanks for that&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 15:53:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/key-error-when-publishing-shapefile-into-feature/m-p/1008515#M5303</guid>
      <dc:creator>SharitaU</dc:creator>
      <dc:date>2020-12-10T15:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Key Error when publishing shapefile into feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/key-error-when-publishing-shapefile-into-feature/m-p/1008632#M5304</link>
      <description>&lt;P&gt;Since my error was dealing with the default parameters being recognized correctly, I instead typed out the parameters which I found here (&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.Item.publish" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.Item.publish&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;Hence I used the code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Publish the shapefile item into a feature layer&lt;BR /&gt;Applications_item = stapefile_item.publish(publish_parameters=None, address_fields=None, output_type=None, overwrite=False, file_type=None, build_initial_cache=False)&lt;BR /&gt;Applications_item&lt;/P&gt;&lt;P&gt;*I thought this was a solution but it did not&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 23:44:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/key-error-when-publishing-shapefile-into-feature/m-p/1008632#M5304</guid>
      <dc:creator>SharitaU</dc:creator>
      <dc:date>2020-12-10T23:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: Key Error when publishing shapefile into feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/key-error-when-publishing-shapefile-into-feature/m-p/1009188#M5313</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/427382"&gt;@SharitaU&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I've already provided two scripts in the link below for appending and overwriting a feature layer:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/correct-workflow-for-publishing-then-updating-hosted-feature/m-p/1007794#M5284" target="_blank"&gt;https://community.esri.com/t5/arcgis-api-for-python-questions/correct-workflow-for-publishing-then-updating-hosted-feature/m-p/1007794#M5284&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I hope that helps.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 01:26:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/key-error-when-publishing-shapefile-into-feature/m-p/1009188#M5313</guid>
      <dc:creator>MehdiPira1</dc:creator>
      <dc:date>2020-12-14T01:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: Key Error when publishing shapefile into feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/key-error-when-publishing-shapefile-into-feature/m-p/1024171#M5514</link>
      <description>&lt;P&gt;I am experiencing the same problem. Uploading the shapefile is OK but publishing it is not. I can publish it manually on ArcGIS Online. I don't think it's a issue with file overwriting as I tried to rename it every time. Have you solved this problem?&lt;/P&gt;</description>
      <pubDate>Sat, 06 Feb 2021 23:10:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/key-error-when-publishing-shapefile-into-feature/m-p/1024171#M5514</guid>
      <dc:creator>LamberWBY</dc:creator>
      <dc:date>2021-02-06T23:10:58Z</dc:date>
    </item>
  </channel>
</rss>

