<?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: Export Item errors in ArcGIS Notebooks Questions</title>
    <link>https://community.esri.com/t5/arcgis-notebooks-questions/export-item-errors/m-p/1117914#M443</link>
    <description>&lt;P&gt;This is resolved.&amp;nbsp; My fault:&amp;nbsp; I had using AdminTools to "copy" the complex feature service in question but it didn't actually copy everything and the "export" option simply unavailable on that particular item.&amp;nbsp; The Notebook appears to run successfully on a valid item.&lt;/P&gt;</description>
    <pubDate>Wed, 17 Nov 2021 21:11:23 GMT</pubDate>
    <dc:creator>JamesCrandall</dc:creator>
    <dc:date>2021-11-17T21:11:23Z</dc:date>
    <item>
      <title>Export Item errors</title>
      <link>https://community.esri.com/t5/arcgis-notebooks-questions/export-item-errors/m-p/1117849#M442</link>
      <description>&lt;P&gt;Hi I am attempting to export a hosted feature server to a FGDB for later download but running into errors.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;KeyError&lt;/SPAN&gt;                                  Traceback (most recent call last)
&lt;SPAN class=""&gt;&amp;lt;ipython-input-34-c3c8826240dd&amp;gt;&lt;/SPAN&gt; in &lt;SPAN class=""&gt;&amp;lt;module&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class=""&gt;     21&lt;/SPAN&gt; print &lt;SPAN class=""&gt;(&lt;/SPAN&gt;exportName&lt;SPAN class=""&gt;)&lt;/SPAN&gt;
&lt;SPAN class=""&gt;     22&lt;/SPAN&gt; 
&lt;SPAN class=""&gt;---&amp;gt; 23&lt;/SPAN&gt; data_item&lt;SPAN class=""&gt;.&lt;/SPAN&gt;export&lt;SPAN class=""&gt;(&lt;/SPAN&gt;exportName&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;"File Geodatabase"&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;

&lt;SPAN class=""&gt;/opt/conda/lib/python3.7/site-packages/arcgis/gis/__init__.py&lt;/SPAN&gt; in &lt;SPAN class=""&gt;export&lt;/SPAN&gt;&lt;SPAN class=""&gt;(self, title, export_format, parameters, wait, enforce_fld_vis, tags, snippet, overwrite)&lt;/SPAN&gt;
&lt;SPAN class=""&gt;   8776&lt;/SPAN&gt;                 params&lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;'exportParameters'&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;"enforceFieldVisibility"&lt;/SPAN&gt; &lt;SPAN class=""&gt;:&lt;/SPAN&gt; enforce_fld_vis &lt;SPAN class=""&gt;}&lt;/SPAN&gt;
&lt;SPAN class=""&gt;   8777&lt;/SPAN&gt;         res &lt;SPAN class=""&gt;=&lt;/SPAN&gt; self&lt;SPAN class=""&gt;.&lt;/SPAN&gt;_portal&lt;SPAN class=""&gt;.&lt;/SPAN&gt;con&lt;SPAN class=""&gt;.&lt;/SPAN&gt;post&lt;SPAN class=""&gt;(&lt;/SPAN&gt;data_path&lt;SPAN class=""&gt;,&lt;/SPAN&gt; params&lt;SPAN class=""&gt;)&lt;/SPAN&gt;
&lt;SPAN class=""&gt;-&amp;gt; 8778&lt;/SPAN&gt;         export_item &lt;SPAN class=""&gt;=&lt;/SPAN&gt; Item&lt;SPAN class=""&gt;(&lt;/SPAN&gt;gis&lt;SPAN class=""&gt;=&lt;/SPAN&gt;self&lt;SPAN class=""&gt;.&lt;/SPAN&gt;_gis&lt;SPAN class=""&gt;,&lt;/SPAN&gt; itemid&lt;SPAN class=""&gt;=&lt;/SPAN&gt;res&lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;'exportItemId'&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;
&lt;SPAN class=""&gt;   8779&lt;/SPAN&gt;         &lt;SPAN class=""&gt;if&lt;/SPAN&gt; wait &lt;SPAN class=""&gt;==&lt;/SPAN&gt; &lt;SPAN class=""&gt;True&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;
&lt;SPAN class=""&gt;   8780&lt;/SPAN&gt;             status &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;"partial"&lt;/SPAN&gt;

&lt;SPAN class=""&gt;KeyError&lt;/SPAN&gt;: 'exportItemId'&lt;/PRE&gt;&lt;P&gt;The code runs fine on a simple hosted service, but fails with error above when run on a feature server with multiple service layers and tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;#import modules
from arcgis.gis import GIS
from arcgis.features import manage_data
import time, os, fnmatch, shutil
from pathlib import Path

#gis = GIS(username="Username", password="Password")
gis = GIS("home")

item_id = '564d5e1840b44ab1b6f4083cfaaf7928'
#item_id = '22b8d8af9b0842ffa622a73655946146'

data_item = gis.content.get(item_id)
data_item.title
itemName = gis.content.get(item_id).title

fgdb_title = itemName
t = time.localtime()
timestamp = time.strftime('%b%Y',t)
exportName = "{}_Download{}".format(itemName, timestamp)
print (exportName)

data_item.export(exportName, "File Geodatabase")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 19:31:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-notebooks-questions/export-item-errors/m-p/1117849#M442</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-11-17T19:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Export Item errors</title>
      <link>https://community.esri.com/t5/arcgis-notebooks-questions/export-item-errors/m-p/1117914#M443</link>
      <description>&lt;P&gt;This is resolved.&amp;nbsp; My fault:&amp;nbsp; I had using AdminTools to "copy" the complex feature service in question but it didn't actually copy everything and the "export" option simply unavailable on that particular item.&amp;nbsp; The Notebook appears to run successfully on a valid item.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 21:11:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-notebooks-questions/export-item-errors/m-p/1117914#M443</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-11-17T21:11:23Z</dc:date>
    </item>
  </channel>
</rss>

