<?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: Python API:  Have AGOL file GDB item object.  How construct proper in_data parameter for ExportXMLworkspaceDocument? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-have-agol-file-gdb-item-object-how/m-p/1280642#M8613</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/139394"&gt;@ThomasCrossman&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You are dealing here with an item object so I don't think you can pass the url, item, or any other endpoint to the &lt;EM&gt;in_data&lt;/EM&gt; parameter.&lt;/P&gt;&lt;P&gt;Answering your questions:&lt;/P&gt;&lt;P&gt;1) No need of setting arcpy.env.workspace at all&lt;/P&gt;&lt;P&gt;2) &lt;EM&gt;in_data&lt;/EM&gt; accepts&amp;nbsp;&lt;SPAN&gt;Feature Class; Feature Dataset; Raster Dataset; Table; Workspace. In your case, you will have to download the item (filegdb) locally, extract it (cause it is compressed) and pass the extracted GDB path into the &lt;EM&gt;in_data&lt;/EM&gt; parameter.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;After executing&amp;nbsp;ExportXMLWorkspaceDocument function you always can upload that XML to your content throught the API (&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.ContentManager.add" target="_self"&gt;ContentManager.add() method&lt;/A&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope that helps, cheers!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Apr 2023 08:32:19 GMT</pubDate>
    <dc:creator>Kepa</dc:creator>
    <dc:date>2023-04-20T08:32:19Z</dc:date>
    <item>
      <title>Python API:  Have AGOL file GDB item object.  How construct proper in_data parameter for ExportXMLworkspaceDocument?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-have-agol-file-gdb-item-object-how/m-p/1279955#M8611</link>
      <description>&lt;P&gt;I would like to use the ExportXMLWorkspaceDocument geoprocessing tool (in arcpy) to generate an XML document (&lt;STRONG&gt;schema only&lt;/STRONG&gt;) from an API for Python item object of a file geodatabase (FGDB) that currently resides in the Content/My Content area of my company's AGOL portal.&amp;nbsp; The FGDB is an export of a hosted feature service (hosted feature layer collection, to be precise) generated with code like:&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;result = item_object.export(feature_layer_name, 'File Geodatabase')
itemID = result.id&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;During the run, I have item_object (the feature service Item) and result (the FGDB Item).&amp;nbsp; I would export the XML document with the geoporcessing tool thus:&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;arcpy.management.ExportXMLWorkspaceDocument(in_data, out_file, 'SCHEMA_ONLY')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am in many ways an AGOL and REST novice (though the Python API does make a lot of sense), and I find the various types of URL formats and what they point to quite confusing.&amp;nbsp; So, I suppose I have&amp;nbsp;&lt;U&gt;two&lt;/U&gt; questions, really:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&amp;nbsp;What value would I use for arcpy.env.workspace?&amp;nbsp; (Maybe I don't need to set this if I am using fully qualified URLs all around?)&lt;/LI&gt;&lt;LI&gt;What value would I use for the&amp;nbsp;&lt;EM&gt;in_data&lt;/EM&gt; parameter of the tool call to refer properly to the FGDB in My Content?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I assume that these values are going to be various combinations of URLs and item IDs, but I am really confused now and have had no luck getting this to work.&amp;nbsp; (I did see that there is an &lt;EM&gt;item_card&lt;/EM&gt; property for an Item object, but even if that would do the same thing as the geoprocesing tool (which I doubt), there seems to be no parameter for restricting to schema only output.)&amp;nbsp; Any help with this stuff would be greatly appreciated.&amp;nbsp; As I have 28 feature services to do this for, I would really like to get the automation working.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 21:57:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-have-agol-file-gdb-item-object-how/m-p/1279955#M8611</guid>
      <dc:creator>ThomasCrossman</dc:creator>
      <dc:date>2023-04-19T21:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: Python API:  Have AGOL file GDB item object.  How construct proper in_data parameter for ExportXMLworkspaceDocument?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-have-agol-file-gdb-item-object-how/m-p/1280642#M8613</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/139394"&gt;@ThomasCrossman&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You are dealing here with an item object so I don't think you can pass the url, item, or any other endpoint to the &lt;EM&gt;in_data&lt;/EM&gt; parameter.&lt;/P&gt;&lt;P&gt;Answering your questions:&lt;/P&gt;&lt;P&gt;1) No need of setting arcpy.env.workspace at all&lt;/P&gt;&lt;P&gt;2) &lt;EM&gt;in_data&lt;/EM&gt; accepts&amp;nbsp;&lt;SPAN&gt;Feature Class; Feature Dataset; Raster Dataset; Table; Workspace. In your case, you will have to download the item (filegdb) locally, extract it (cause it is compressed) and pass the extracted GDB path into the &lt;EM&gt;in_data&lt;/EM&gt; parameter.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;After executing&amp;nbsp;ExportXMLWorkspaceDocument function you always can upload that XML to your content throught the API (&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.ContentManager.add" target="_self"&gt;ContentManager.add() method&lt;/A&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope that helps, cheers!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 08:32:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-have-agol-file-gdb-item-object-how/m-p/1280642#M8613</guid>
      <dc:creator>Kepa</dc:creator>
      <dc:date>2023-04-20T08:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: Python API:  Have AGOL file GDB item object.  How construct proper in_data parameter for ExportXMLworkspaceDocument?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-have-agol-file-gdb-item-object-how/m-p/1280701#M8614</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/433412"&gt;@Kepa&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, indeed.&amp;nbsp; That does answer my question--an unfortunate answer but just what I needed to know.&amp;nbsp; I was trying to avoid the download/uzip part, as each of the 28 FGDBs (exported feature services) would be 2 to 10GB in size.&amp;nbsp; I simply don't have the time or the local disk space to do the download/unzip.&amp;nbsp; I suspect that a FGDB exported to My Content from a feature service on ArcGIS Online is some kind of compressed archive that isn't directly readable.&amp;nbsp; So, perhaps I will submit an Idea that arcpy implementations of geoprocessing tools that operate on workspaces (like ExportXMLWorkspaceDocument) be capable of consuming URLs of exported FGDBs on ArcGIS Online as workspaces for &lt;EM&gt;input_data&lt;/EM&gt;.&amp;nbsp; That would certainly up the game!&amp;nbsp; Thanks for the help,&amp;nbsp;@Kepa.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 12:32:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-have-agol-file-gdb-item-object-how/m-p/1280701#M8614</guid>
      <dc:creator>ThomasCrossman</dc:creator>
      <dc:date>2023-04-20T12:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: Python API:  Have AGOL file GDB item object.  How construct proper in_data parameter for ExportXMLworkspaceDocument?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-have-agol-file-gdb-item-object-how/m-p/1281092#M8617</link>
      <description>&lt;P&gt;In Desktop, I often just select one feature, then export to new featureclass to maintain all the schema info, then delete the one feature to have new dataset with matching schema.&lt;/P&gt;&lt;P&gt;Not sure if this would work for you, but could you use the API to make a copy of the feature services, truncate the data, then export to FGDB (which is now pretty much just the schema) which could then be copied locally, and exported to xml.&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 22:47:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-have-agol-file-gdb-item-object-how/m-p/1281092#M8617</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2023-04-20T22:47:17Z</dc:date>
    </item>
  </channel>
</rss>

