<?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: items = gis.content.search(query='')  for a specific AGOL group in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/items-gis-content-search-query-for-a-specific-agol/m-p/1570828#M10987</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/467729"&gt;@SanchezNuñez&lt;/a&gt;&amp;nbsp;Wanted to say thank you for this gem.&amp;nbsp; This is exactly what I have been working on to help staff manage there data from various field project in AGOL.&amp;nbsp; Thank you!&lt;/P&gt;</description>
    <pubDate>Sun, 22 Dec 2024 05:16:24 GMT</pubDate>
    <dc:creator>JenFrazer_USFS_NR-GISS-IRIN</dc:creator>
    <dc:date>2024-12-22T05:16:24Z</dc:date>
    <item>
      <title>items = gis.content.search(query='')  for a specific AGOL group</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/items-gis-content-search-query-for-a-specific-agol/m-p/1552827#M10801</link>
      <description>&lt;P&gt;Good morning,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking for a way to select all hosted feature classes that belong to a specific group&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;items = gis.content.search(query='')&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Oct 2024 15:30:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/items-gis-content-search-query-for-a-specific-agol/m-p/1552827#M10801</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2024-10-28T15:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: items = gis.content.search(query='')  for a specific AGOL group</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/items-gis-content-search-query-for-a-specific-agol/m-p/1552893#M10802</link>
      <description>&lt;P&gt;You can do this at least two ways:&lt;/P&gt;
&lt;P&gt;Like this:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;group_id = "1234_your_group_id_5678"
gis.content.search(query=f"group: {group_id}", item_type="Feature Service")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or like this:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;group_id = "1234_your_group_id_5678"
group = gis.groups.get(group_id)
group.search(query="type:Feature Service")&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 28 Oct 2024 17:16:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/items-gis-content-search-query-for-a-specific-agol/m-p/1552893#M10802</guid>
      <dc:creator>EarlMedina</dc:creator>
      <dc:date>2024-10-28T17:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: items = gis.content.search(query='')  for a specific AGOL group</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/items-gis-content-search-query-for-a-specific-agol/m-p/1554769#M10840</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/86309"&gt;@EarlMedina&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I wrote and it works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Retrieve Group ID&lt;BR /&gt;group = GIS.groups.get(group_id)&lt;BR /&gt;print (group)&lt;BR /&gt;&lt;BR /&gt;# List all feature layers collections in the group&lt;BR /&gt;feature_layer_collections = []&lt;BR /&gt;for item in group.content():&lt;BR /&gt;## print (item)&lt;BR /&gt;## print (item.type)&lt;BR /&gt;## print (item.id)&lt;BR /&gt;# Filter for feature layer items&lt;BR /&gt;if item.type == "Feature Service":&lt;BR /&gt;#Get the Feature Layer Collection&lt;BR /&gt;flc = FeatureLayerCollection.fromitem(item)&lt;BR /&gt;feature_layer_collections.append(flc)&lt;BR /&gt;#print ("Append")&lt;BR /&gt;# Create a unique export title based on the item name and timestamp&lt;BR /&gt;# Create a datetime object&lt;BR /&gt;now = datetime.datetime.now()&lt;BR /&gt;formatted_date = now.strftime("%Y%m%d_%H:%M:%S")&lt;BR /&gt;## export_title = f"{item.title}_backup_{formatted_date}"&lt;BR /&gt;export_title = f"{formatted_date}_backup_{item.title}"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# Export the item to File Geodatabase format&lt;BR /&gt;print(f"Exporting {item.title}...")&lt;BR /&gt;export_item = item.export(title=export_title, export_format="File Geodatabase",parameters=None,wait=True)&lt;BR /&gt;&lt;BR /&gt;# Download the exported file to the backup directory&lt;BR /&gt;export_path = os.path.join(backup_directory, f"{export_title}.zip")&lt;BR /&gt;export_item.download(backup_directory)&lt;BR /&gt;&lt;BR /&gt;# Clean up the export item from ArcGIS Online&lt;BR /&gt;export_item.delete()&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2024 17:16:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/items-gis-content-search-query-for-a-specific-agol/m-p/1554769#M10840</guid>
      <dc:creator>SanchezNuñez</dc:creator>
      <dc:date>2024-11-01T17:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: items = gis.content.search(query='')  for a specific AGOL group</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/items-gis-content-search-query-for-a-specific-agol/m-p/1570828#M10987</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/467729"&gt;@SanchezNuñez&lt;/a&gt;&amp;nbsp;Wanted to say thank you for this gem.&amp;nbsp; This is exactly what I have been working on to help staff manage there data from various field project in AGOL.&amp;nbsp; Thank you!&lt;/P&gt;</description>
      <pubDate>Sun, 22 Dec 2024 05:16:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/items-gis-content-search-query-for-a-specific-agol/m-p/1570828#M10987</guid>
      <dc:creator>JenFrazer_USFS_NR-GISS-IRIN</dc:creator>
      <dc:date>2024-12-22T05:16:24Z</dc:date>
    </item>
  </channel>
</rss>

