<?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 How to query and download multiple feature layers with Notebook at single time? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-query-and-download-multiple-feature-layers/m-p/1353859#M9463</link>
    <description>&lt;P&gt;Hello everybody, I have been able to export and save a single feature layer at a time to my local drive, but I am wanting to manipulate the code to allow multiple feature layers to export at once.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I was hoping it would be as simple as altering the query to use the OR statement or a comma in between feature layer ID, but that has still only allowed me to download one of the feature ID listed.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I also tried adding&amp;nbsp;num_items = int(50) and&amp;nbsp;max_items=num_items to the script, using this &lt;A href="https://support.esri.com/en-us/knowledge-base/how-to-download-feature-service-items-from-arcgis-onlin-000018909" target="_self"&gt;tech support article&lt;/A&gt; but had no luck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Really appreciate any help with this&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def downloadUserItems(owner, downloadFormat):
try:
# Search items by layers
items = gis.content.search(query='e044b2836f37419f878c9dabc9389bd3', item_type='Feature Service')

# Loop through each item and if equal to Feature service then download it
for item in items:
if item.type == 'Feature Service':
# Retain the feature service title
feature_title = item.title
version = dt.datetime.now().strftime("_%d_%b_%Y")
result = item.export('{}'.format(feature_title) + version, downloadFormat)

# Modify the download path to include the feature service title
download_path = r'C:\Users\GISNOOB\Backups\{}'.format(feature_title)
result.download(download_path)

# Delete the item after it downloads to save space (OPTIONAL)
result.delete()
except Exception as e:
print(e)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Nov 2023 23:01:23 GMT</pubDate>
    <dc:creator>Adam_Bourque</dc:creator>
    <dc:date>2023-11-27T23:01:23Z</dc:date>
    <item>
      <title>How to query and download multiple feature layers with Notebook at single time?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-query-and-download-multiple-feature-layers/m-p/1353859#M9463</link>
      <description>&lt;P&gt;Hello everybody, I have been able to export and save a single feature layer at a time to my local drive, but I am wanting to manipulate the code to allow multiple feature layers to export at once.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I was hoping it would be as simple as altering the query to use the OR statement or a comma in between feature layer ID, but that has still only allowed me to download one of the feature ID listed.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I also tried adding&amp;nbsp;num_items = int(50) and&amp;nbsp;max_items=num_items to the script, using this &lt;A href="https://support.esri.com/en-us/knowledge-base/how-to-download-feature-service-items-from-arcgis-onlin-000018909" target="_self"&gt;tech support article&lt;/A&gt; but had no luck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Really appreciate any help with this&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def downloadUserItems(owner, downloadFormat):
try:
# Search items by layers
items = gis.content.search(query='e044b2836f37419f878c9dabc9389bd3', item_type='Feature Service')

# Loop through each item and if equal to Feature service then download it
for item in items:
if item.type == 'Feature Service':
# Retain the feature service title
feature_title = item.title
version = dt.datetime.now().strftime("_%d_%b_%Y")
result = item.export('{}'.format(feature_title) + version, downloadFormat)

# Modify the download path to include the feature service title
download_path = r'C:\Users\GISNOOB\Backups\{}'.format(feature_title)
result.download(download_path)

# Delete the item after it downloads to save space (OPTIONAL)
result.delete()
except Exception as e:
print(e)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2023 23:01:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-query-and-download-multiple-feature-layers/m-p/1353859#M9463</guid>
      <dc:creator>Adam_Bourque</dc:creator>
      <dc:date>2023-11-27T23:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to query and download multiple feature layers with Notebook at single time?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-query-and-download-multiple-feature-layers/m-p/1356254#M9464</link>
      <description>&lt;P&gt;Update: As of now I had a work colleague inform me they use backup features by AGOL folder which is what I changed my code to. I am still curious if there is an easy code manipulation to this code to get multiple layers, if I have a use-case of layers not in one folder.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 13:37:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-query-and-download-multiple-feature-layers/m-p/1356254#M9464</guid>
      <dc:creator>Adam_Bourque</dc:creator>
      <dc:date>2023-12-04T13:37:50Z</dc:date>
    </item>
  </channel>
</rss>

