<?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 Can't update content item data in a folder in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-update-content-item-data-in-a-folder/m-p/1207423#M7689</link>
    <description>&lt;P&gt;HI,&amp;nbsp;&lt;/P&gt;&lt;P&gt;My script to update a content item data (file) fails when the item is in a folder.&amp;nbsp; Seems like i might be missing something simple but can't figure out what.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Setup:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ArcGIS API for Python 2.0.1&lt;/LI&gt;&lt;LI&gt;Enterprise portal v 10.9.1 ... seems to work with AGOL&lt;/LI&gt;&lt;LI&gt;Content item (tpk file) published/upload as simple file not as layer&lt;/LI&gt;&lt;LI&gt;I can reproduce with the simple code below in the ArcPro python window&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Works fine if the item is in the owner root but fails when item is put into a folder&lt;/LI&gt;&lt;LI&gt;Error:&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;File "D:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py", line 12961, in update&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;status = self._gis.content._add_by_part(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;File "D:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py", line 5102, in _add_by_part&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;path += "/" + folder_id&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TypeError: can only concatenate str (not "NoneType") to str&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Code:&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
gis = GIS('home')	
id = '{item_guid_here}'
existing_tpk = gis.content.get(id)
tpk_path = r'C:\{my_new_awesome_file_here}.tpk'
existing_tpk.update(data=tpk_path)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Aug 2022 15:26:12 GMT</pubDate>
    <dc:creator>FredSpataro</dc:creator>
    <dc:date>2022-08-30T15:26:12Z</dc:date>
    <item>
      <title>Can't update content item data in a folder</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-update-content-item-data-in-a-folder/m-p/1207423#M7689</link>
      <description>&lt;P&gt;HI,&amp;nbsp;&lt;/P&gt;&lt;P&gt;My script to update a content item data (file) fails when the item is in a folder.&amp;nbsp; Seems like i might be missing something simple but can't figure out what.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Setup:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ArcGIS API for Python 2.0.1&lt;/LI&gt;&lt;LI&gt;Enterprise portal v 10.9.1 ... seems to work with AGOL&lt;/LI&gt;&lt;LI&gt;Content item (tpk file) published/upload as simple file not as layer&lt;/LI&gt;&lt;LI&gt;I can reproduce with the simple code below in the ArcPro python window&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Works fine if the item is in the owner root but fails when item is put into a folder&lt;/LI&gt;&lt;LI&gt;Error:&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;File "D:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py", line 12961, in update&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;status = self._gis.content._add_by_part(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;File "D:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py", line 5102, in _add_by_part&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;path += "/" + folder_id&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TypeError: can only concatenate str (not "NoneType") to str&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Code:&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
gis = GIS('home')	
id = '{item_guid_here}'
existing_tpk = gis.content.get(id)
tpk_path = r'C:\{my_new_awesome_file_here}.tpk'
existing_tpk.update(data=tpk_path)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2022 15:26:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-update-content-item-data-in-a-folder/m-p/1207423#M7689</guid>
      <dc:creator>FredSpataro</dc:creator>
      <dc:date>2022-08-30T15:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: Can't update content item data in a folder</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-update-content-item-data-in-a-folder/m-p/1231906#M8009</link>
      <description>&lt;P&gt;Tech support has verified the issue as bug in 2.0.1:&amp;nbsp;BUG-000152141&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 18:58:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-update-content-item-data-in-a-folder/m-p/1231906#M8009</guid>
      <dc:creator>FredSpataro</dc:creator>
      <dc:date>2022-11-15T18:58:22Z</dc:date>
    </item>
  </channel>
</rss>

