<?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 ArcGIS Online content cannot be exported through function in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcgis-online-content-cannot-be-exported-through/m-p/1059103#M40131</link>
    <description>&lt;P&gt;I tried to download some ArcGIS Online content as Shapefile from Python. When I set the parameters manually, it downloaded the shapefile as .zip. However, when calling the function, it returned the&lt;/P&gt;&lt;LI-SPOILER&gt;error:downloadShapefiles(plot_id = plot)&lt;BR /&gt;Unable to export item.&lt;BR /&gt;Item type'file' is not supported for export, The item needs to be of type url&lt;BR /&gt;Item '3bf5df57ab464b2c9855e797fd3ba24f' is of invalid type 'Service Definition' Item type for export needs to be 'Feature Service', 'Vector Tile Service' or 'Scene Service'&lt;BR /&gt;(Error Code: 400)&lt;/LI-SPOILER&gt;&lt;P&gt;The function is just:&lt;/P&gt;&lt;LI-SPOILER&gt;def downloadShapefiles(plot_id):&lt;BR /&gt;&amp;nbsp; try:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Search items by username&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cont = gis.content.search("owner:{0}".format("MyName"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for shp in cont:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if plot_id in shp.title:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; shapefile = shp.export("layer {}".format(shp.type), "Shapefile")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; shapefile.download(dir_shp(plot_id))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; shapefile.delete()&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; except Exception as e:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; print(e)&lt;/LI-SPOILER&gt;&lt;P&gt;Which was modified a bit from the ArcGIS examples.&lt;BR /&gt;When I set plot_id manually and shp = shps[2] (which is an instance where the condition plot_id in shp.title is met), it downloaded without problems.&lt;BR /&gt;&lt;BR /&gt;What went wrong here?&lt;/P&gt;</description>
    <pubDate>Tue, 18 May 2021 18:40:44 GMT</pubDate>
    <dc:creator>Manu</dc:creator>
    <dc:date>2021-05-18T18:40:44Z</dc:date>
    <item>
      <title>ArcGIS Online content cannot be exported through function</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcgis-online-content-cannot-be-exported-through/m-p/1059103#M40131</link>
      <description>&lt;P&gt;I tried to download some ArcGIS Online content as Shapefile from Python. When I set the parameters manually, it downloaded the shapefile as .zip. However, when calling the function, it returned the&lt;/P&gt;&lt;LI-SPOILER&gt;error:downloadShapefiles(plot_id = plot)&lt;BR /&gt;Unable to export item.&lt;BR /&gt;Item type'file' is not supported for export, The item needs to be of type url&lt;BR /&gt;Item '3bf5df57ab464b2c9855e797fd3ba24f' is of invalid type 'Service Definition' Item type for export needs to be 'Feature Service', 'Vector Tile Service' or 'Scene Service'&lt;BR /&gt;(Error Code: 400)&lt;/LI-SPOILER&gt;&lt;P&gt;The function is just:&lt;/P&gt;&lt;LI-SPOILER&gt;def downloadShapefiles(plot_id):&lt;BR /&gt;&amp;nbsp; try:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Search items by username&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cont = gis.content.search("owner:{0}".format("MyName"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for shp in cont:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if plot_id in shp.title:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; shapefile = shp.export("layer {}".format(shp.type), "Shapefile")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; shapefile.download(dir_shp(plot_id))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; shapefile.delete()&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; except Exception as e:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; print(e)&lt;/LI-SPOILER&gt;&lt;P&gt;Which was modified a bit from the ArcGIS examples.&lt;BR /&gt;When I set plot_id manually and shp = shps[2] (which is an instance where the condition plot_id in shp.title is met), it downloaded without problems.&lt;BR /&gt;&lt;BR /&gt;What went wrong here?&lt;/P&gt;</description>
      <pubDate>Tue, 18 May 2021 18:40:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcgis-online-content-cannot-be-exported-through/m-p/1059103#M40131</guid>
      <dc:creator>Manu</dc:creator>
      <dc:date>2021-05-18T18:40:44Z</dc:date>
    </item>
  </channel>
</rss>

