<?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 New AGOL Recycle Bin Breaks My Python Scripts That Overwrite Feature Service's With Sync Enabled in ArcGIS Field Maps Questions</title>
    <link>https://community.esri.com/t5/arcgis-field-maps-questions/new-agol-recycle-bin-breaks-my-python-scripts-that/m-p/1503225#M9042</link>
    <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;I work in a one-man GIS team, and one of my main tasks is processing data collected via Field Maps. Once the field workers sync their data collection devices, I process multiple feature classes into a new hosted feature service in AGOL.&lt;/P&gt;&lt;P&gt;Throughout my scripts process it checks if certain feature services exist and if they do to delete them. With the new recycle bin feature my script fails because it is not "permanently deleted" it is just hanging out in the recycle bin. I can manually navigate to the recycle bin and manually delete it and my script works like it normally does.&lt;/P&gt;&lt;P&gt;Has anyone else experienced something like this? I imagine there must be a way to permanently delete an item in AGOL&amp;nbsp; and have it not enter the recycle bin just deleted.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jul 2024 19:55:28 GMT</pubDate>
    <dc:creator>LucasNeal</dc:creator>
    <dc:date>2024-07-09T19:55:28Z</dc:date>
    <item>
      <title>New AGOL Recycle Bin Breaks My Python Scripts That Overwrite Feature Service's With Sync Enabled</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/new-agol-recycle-bin-breaks-my-python-scripts-that/m-p/1503225#M9042</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;I work in a one-man GIS team, and one of my main tasks is processing data collected via Field Maps. Once the field workers sync their data collection devices, I process multiple feature classes into a new hosted feature service in AGOL.&lt;/P&gt;&lt;P&gt;Throughout my scripts process it checks if certain feature services exist and if they do to delete them. With the new recycle bin feature my script fails because it is not "permanently deleted" it is just hanging out in the recycle bin. I can manually navigate to the recycle bin and manually delete it and my script works like it normally does.&lt;/P&gt;&lt;P&gt;Has anyone else experienced something like this? I imagine there must be a way to permanently delete an item in AGOL&amp;nbsp; and have it not enter the recycle bin just deleted.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 19:55:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/new-agol-recycle-bin-breaks-my-python-scripts-that/m-p/1503225#M9042</guid>
      <dc:creator>LucasNeal</dc:creator>
      <dc:date>2024-07-09T19:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: New AGOL Recycle Bin Breaks My Python Scripts That Overwrite Feature Service's With Sync Enabled</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/new-agol-recycle-bin-breaks-my-python-scripts-that/m-p/1503245#M9043</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/695255"&gt;@LucasNeal&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;item delete has a "permanent" parameter available (&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#item" target="_blank"&gt;https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#item&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;"Optional boolean. Available in ArcGIS Online, setting to True will permanently delete the item rather than sending it to the recycle bin."&lt;/P&gt;&lt;P&gt;This might be what you are looking for?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 20:13:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/new-agol-recycle-bin-breaks-my-python-scripts-that/m-p/1503245#M9043</guid>
      <dc:creator>JustinColville</dc:creator>
      <dc:date>2024-07-09T20:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: New AGOL Recycle Bin Breaks My Python Scripts That Overwrite Feature Service's With Sync Enabled</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/new-agol-recycle-bin-breaks-my-python-scripts-that/m-p/1503249#M9044</link>
      <description>&lt;P&gt;Maybe there is a programmatic way to toggle off the AGOL Recycle bin while you are running your scripts?&lt;/P&gt;&lt;P&gt;4/21/25&lt;/P&gt;&lt;P&gt;I was just able to apply this solution to a new script I had created.&amp;nbsp; Thank you very much.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Apr 2025 17:19:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/new-agol-recycle-bin-breaks-my-python-scripts-that/m-p/1503249#M9044</guid>
      <dc:creator>MikeVolz</dc:creator>
      <dc:date>2025-04-21T17:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: New AGOL Recycle Bin Breaks My Python Scripts That Overwrite Feature Service's With Sync Enabled</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/new-agol-recycle-bin-breaks-my-python-scripts-that/m-p/1503886#M9056</link>
      <description>&lt;P&gt;Thank you Justin you are a life saver!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 22:15:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/new-agol-recycle-bin-breaks-my-python-scripts-that/m-p/1503886#M9056</guid>
      <dc:creator>LucasNeal</dc:creator>
      <dc:date>2024-07-10T22:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: New AGOL Recycle Bin Breaks My Python Scripts That Overwrite Feature Service's With Sync Enabled</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/new-agol-recycle-bin-breaks-my-python-scripts-that/m-p/1506726#M9104</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/80958"&gt;@JustinColville&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone successfully been able to permanently delete an AGOL item via Python AFTER ESRI added the recycle bin?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
gis = GIS("home")

item_id='767ff8fe699047d7bc0e74c0f15a63a4' #this is the service_ID of the hosted feature layer to delete

itemToDelete = gis.content.get(item_id)
itemToDelete.delete(permanent=True)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Running this code in AGOL Notebooks as well as Python 3.9.16 on my computer with Pro 3.1.2 I get the following error message:&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;TypeError                                 Traceback (most recent call last)
/tmp/ipykernel_19/3146111176.py in &amp;lt;cell line: 7&amp;gt;()
      5 
      6 itemToDelete = gis.content.get(item_id)
----&amp;gt; 7 itemToDelete.delete(permanent=True)

TypeError: delete() got an unexpected keyword argument 'permanent'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 18:06:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/new-agol-recycle-bin-breaks-my-python-scripts-that/m-p/1506726#M9104</guid>
      <dc:creator>Tom_Laue</dc:creator>
      <dc:date>2024-07-18T18:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: New AGOL Recycle Bin Breaks My Python Scripts That Overwrite Feature Service's With Sync Enabled</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/new-agol-recycle-bin-breaks-my-python-scripts-that/m-p/1507248#M9111</link>
      <description>&lt;P&gt;I too am seeing: TypeError: delete() got an unexpected keyword argument 'permanent'&lt;/P&gt;&lt;P&gt;I had Python that was deleting items on AGOL and then copying up to AGOL updated like named items.&amp;nbsp; After we turned on the recycle bin the copying up wasn't working anymore since the like named items were in the Recycle Bin.&amp;nbsp; Found this thread but now seeing issues with the 'permanent' option.&lt;/P&gt;&lt;P&gt;I am retrieving the item by name but have also retrieved it by item ID with the same results.&lt;/P&gt;&lt;P&gt;Python 3.9.18&amp;nbsp;&amp;nbsp; ArcGIS Pro 3.2.0&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2024 12:29:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/new-agol-recycle-bin-breaks-my-python-scripts-that/m-p/1507248#M9111</guid>
      <dc:creator>GregHorne</dc:creator>
      <dc:date>2024-07-19T12:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: New AGOL Recycle Bin Breaks My Python Scripts That Overwrite Feature Service's With Sync Enabled</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/new-agol-recycle-bin-breaks-my-python-scripts-that/m-p/1508462#M9120</link>
      <description>&lt;P&gt;I was getting the same error trying to use &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;item.delete(permanent=True)&lt;/FONT&gt;&lt;/STRONG&gt; in an ArcGIS Notebook&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/33288"&gt;@GregHorne&lt;/a&gt;,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/299157"&gt;@Tom_Laue&lt;/a&gt;.&amp;nbsp; But once I updated my Notebook to use the latest runtime it worked fine and the item is deleted permanently without going anywhere near the recycle bin.&amp;nbsp; The Notebook Runtime setting is on the Setting page of the item in AGOL, I just set it to the most recent version:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MappyIan_0-1721728017908.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/110345i93E8B8FC1B5E79F2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MappyIan_0-1721728017908.png" alt="MappyIan_0-1721728017908.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 09:49:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/new-agol-recycle-bin-breaks-my-python-scripts-that/m-p/1508462#M9120</guid>
      <dc:creator>MappyIan</dc:creator>
      <dc:date>2024-07-23T09:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: New AGOL Recycle Bin Breaks My Python Scripts That Overwrite Feature Service's With Sync Enabled</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/new-agol-recycle-bin-breaks-my-python-scripts-that/m-p/1509233#M9131</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/299157"&gt;@Tom_Laue&lt;/a&gt;&amp;nbsp; For executing from Python on the desktop, it looks like the issue is that one needs to use arcgis (ArcGIS API for Python) v 2.3.0 which comes with ArcGIS Pro v3.3.0.&amp;nbsp; I tried using Pro v3.1 and v3.2 which comes&amp;nbsp; with arcgis v2.2.0.1.&lt;/P&gt;&lt;P&gt;I am not familiar with cloning Python environments but I did try that with Pro v3.1 and v3.2 and then attempted to update the arcgis package but that did not help.&amp;nbsp; It never upgraded out of v2.2.0.x&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 13:17:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/new-agol-recycle-bin-breaks-my-python-scripts-that/m-p/1509233#M9131</guid>
      <dc:creator>GregHorne</dc:creator>
      <dc:date>2024-07-24T13:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: New AGOL Recycle Bin Breaks My Python Scripts That Overwrite Feature Service's With Sync Enabled</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/new-agol-recycle-bin-breaks-my-python-scripts-that/m-p/1545235#M9692</link>
      <description>&lt;P&gt;Yes,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/476936"&gt;@MappyIan&lt;/a&gt;&amp;nbsp;-- that solved my problem.&lt;BR /&gt;&lt;BR /&gt;I wanted to share what I ended up doing.&lt;BR /&gt;&lt;BR /&gt;I'm downloading AGOL hosted feature layers to GDB on a nightly basis (via Python and Task Scheduler).&lt;BR /&gt;Every time I do this, it creates a File GDB in AGOL that I used to delete right after it's creation.&lt;BR /&gt;Since July 2024, it would now go to the Recycle Bin for 14 days (which consumes credits as these are &amp;gt;1 GB files).&lt;BR /&gt;&lt;BR /&gt;Instead of deleting the File GDB, I modified my script to add a tag to each item: 'ToDelete'&lt;BR /&gt;&lt;BR /&gt;Then in AGOL Notebooks (using Runtime 10), I schedule a script daily to delete content with that tag.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS

gis = GIS("home")
    
def find_items_with_tag(tag):
    
    
    # Search for items with the specified tag
    #items = gis.content.search(query="tags: = 'ToDelete'", max_items=100 )
    items = gis.content.search(query="tags: = 'ToDelete'",item_type="File Geodatabase", max_items=300 )
    
    # Extract and return the global IDs of the found items
    global_ids = [item.id for item in items]
    return global_ids

if __name__ == "__main__":
    tag_to_search = "ToDelete"
    item_ids_list = find_items_with_tag(tag_to_search)
    
    print("Global IDs of items with tag '{}':".format(tag_to_search))
    for item_id in item_ids_list:
        print(item_id )
        itemToDelete = gis.content.get(item_id)
        itemToDelete.delete(permanent=True)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2024 15:43:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/new-agol-recycle-bin-breaks-my-python-scripts-that/m-p/1545235#M9692</guid>
      <dc:creator>Tom_Laue</dc:creator>
      <dc:date>2024-10-03T15:43:09Z</dc:date>
    </item>
  </channel>
</rss>

