<?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: Delete features from featureservice in ArcGIS GeoAnalytics Server Questions</title>
    <link>https://community.esri.com/t5/arcgis-geoanalytics-server-questions/delete-features-from-featureservice/m-p/812712#M56</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the &lt;A href="http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r3000000w4000000"&gt;deleteFeatures &lt;/A&gt;with your REST URL.&amp;nbsp; Ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://services.arcgis.com/Fz6BBJUji5ArUSDM/ArcGIS/rest/services/Holmdel_Parcels/FeatureServer/0/deleteFeatures" title="http://services.arcgis.com/Fz6BBJUji5ArUSDM/ArcGIS/rest/services/Holmdel_Parcels/FeatureServer/0/deleteFeatures"&gt;http://services.arcgis.com/BJUji5ArUSDM/ArcGIS/rest/services/Parcels/FeatureServer/0/deleteFeatures&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to download the feature class, perform the delete, and then overwrite the hosted feature service take a look at the following tool:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://epro.maps.arcgis.com/home/item.html?id=16e5cc64178941839eca62837f168ec9" title="http://epro.maps.arcgis.com/home/item.html?id=16e5cc64178941839eca62837f168ec9"&gt;http://epro.maps.arcgis.com/home/item.html?id=16e5cc64178941839eca62837f168ec9&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Jun 2015 17:15:19 GMT</pubDate>
    <dc:creator>JakeSkinner</dc:creator>
    <dc:date>2015-06-22T17:15:19Z</dc:date>
    <item>
      <title>Delete features from featureservice</title>
      <link>https://community.esri.com/t5/arcgis-geoanalytics-server-questions/delete-features-from-featureservice/m-p/812711#M55</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have collected &amp;gt; 100k features in a hosted feature service (Service definition with 1000 records) and like to delete the features from time to time.&lt;/P&gt;&lt;P&gt;Doing manually, ArcMap allows downloading only 1000 features by time (Service definition with 1000 records), REST (with the WHERE-query 1=1) doesn't work. I get a weird, cryptical answer form the server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anybody experience and a solution?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2015 15:21:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoanalytics-server-questions/delete-features-from-featureservice/m-p/812711#M55</guid>
      <dc:creator>ChristianSailer</dc:creator>
      <dc:date>2015-06-22T15:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: Delete features from featureservice</title>
      <link>https://community.esri.com/t5/arcgis-geoanalytics-server-questions/delete-features-from-featureservice/m-p/812712#M56</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the &lt;A href="http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r3000000w4000000"&gt;deleteFeatures &lt;/A&gt;with your REST URL.&amp;nbsp; Ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://services.arcgis.com/Fz6BBJUji5ArUSDM/ArcGIS/rest/services/Holmdel_Parcels/FeatureServer/0/deleteFeatures" title="http://services.arcgis.com/Fz6BBJUji5ArUSDM/ArcGIS/rest/services/Holmdel_Parcels/FeatureServer/0/deleteFeatures"&gt;http://services.arcgis.com/BJUji5ArUSDM/ArcGIS/rest/services/Parcels/FeatureServer/0/deleteFeatures&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to download the feature class, perform the delete, and then overwrite the hosted feature service take a look at the following tool:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://epro.maps.arcgis.com/home/item.html?id=16e5cc64178941839eca62837f168ec9" title="http://epro.maps.arcgis.com/home/item.html?id=16e5cc64178941839eca62837f168ec9"&gt;http://epro.maps.arcgis.com/home/item.html?id=16e5cc64178941839eca62837f168ec9&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2015 17:15:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoanalytics-server-questions/delete-features-from-featureservice/m-p/812712#M56</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2015-06-22T17:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: Delete features from featureservice</title>
      <link>https://community.esri.com/t5/arcgis-geoanalytics-server-questions/delete-features-from-featureservice/m-p/812713#M57</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jake&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank for your quick reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my case &lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r3000000w4000000" rel="nofollow" style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #287433;" target="_blank"&gt;deleteFeatures &lt;/A&gt;​&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;with your REST URL works for around 2'000 features... but not for 95'000...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Using your script in ArcGIS 10.2.2 results in error message;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Failed script DownloadService...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Users\csailer\Downloads\Export_Feature_Service\Download Service with Attachments.py", line 92, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fs.load(fsURL)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\arcobjects\arcobjects.py", line 173, in load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return convertArcObjectToPythonObject(self._arc_object.Load(*gp_fixargs(args)))&lt;/P&gt;&lt;P&gt;RuntimeError: RecordSetObject: Cannot open table for Load&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Failed to execute (DownloadService).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, you have mentioned overwriting the hosted fs with your script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 06:24:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoanalytics-server-questions/delete-features-from-featureservice/m-p/812713#M57</guid>
      <dc:creator>ChristianSailer2</dc:creator>
      <dc:date>2015-06-23T06:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Delete features from featureservice</title>
      <link>https://community.esri.com/t5/arcgis-geoanalytics-server-questions/delete-features-from-featureservice/m-p/812714#M58</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jake&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;again me. I tried to do some workaroudn. I can delete stepwise features (each time 1000) of my 95'000 fs. services. THE question is why I cannot delete more than ~2000 features from hosted fs per request?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is ArcGIS Online limiting this request due to server traffic? Why I'm not able to leave a sql statement like;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE FROM &lt;EM&gt;table_name&lt;/EM&gt;;&lt;/P&gt;&lt;P&gt; or&lt;/P&gt;&lt;P&gt;DELETE * FROM &lt;EM&gt;table_name&lt;/EM&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 10:34:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoanalytics-server-questions/delete-features-from-featureservice/m-p/812714#M58</guid>
      <dc:creator>ChristianSailer2</dc:creator>
      <dc:date>2015-06-23T10:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Delete features from featureservice</title>
      <link>https://community.esri.com/t5/arcgis-geoanalytics-server-questions/delete-features-from-featureservice/m-p/812715#M59</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure the max amount of features you can delete at once for an ArcGIS Online Hosted Feature Service.&amp;nbsp; One thing you could do is use a pythons script to delete features 1000 at a time.&amp;nbsp; Ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import urllib, urllib2, json, smtplib

username = "user"
password = "password"

&lt;SPAN&gt;tokenURL = '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https://www.arcgis.com/sharing/rest/generateToken" target="_blank"&gt;https://www.arcgis.com/sharing/rest/generateToken&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;
&lt;SPAN&gt;params = {'f': 'pjson', 'username': username, 'password': password, 'referer': '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http://www.arcgis.com" target="_blank"&gt;http://www.arcgis.com&lt;/A&gt;&lt;SPAN&gt;'}&lt;/SPAN&gt;
req = urllib2.Request(tokenURL, urllib.urlencode(params))
response = urllib2.urlopen(req)
data = json.load(response)
token = data['token']

x = 1000

while x &amp;lt;= 95000:
&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; url = '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http://services.arcgis.com/Fz6ji5ArUSDM/ArcGIS/rest/services/Parcels/FeatureServer/0/deleteFeatures" target="_blank"&gt;http://services.arcgis.com/Fz6ji5ArUSDM/ArcGIS/rest/services/Parcels/FeatureServer/0/deleteFeatures&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; where = "OBJECTID &amp;lt;= " + str(x)
&amp;nbsp;&amp;nbsp;&amp;nbsp; params = {'f': 'pjson', 'where': where, 'token': token}
&amp;nbsp;&amp;nbsp;&amp;nbsp; req = urllib2.Request(url, urllib.urlencode(params))
&amp;nbsp;&amp;nbsp;&amp;nbsp; response = urllib2.urlopen(req)
&amp;nbsp;&amp;nbsp;&amp;nbsp; x += 1000&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:34:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoanalytics-server-questions/delete-features-from-featureservice/m-p/812715#M59</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-12T09:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: Delete features from featureservice</title>
      <link>https://community.esri.com/t5/arcgis-geoanalytics-server-questions/delete-features-from-featureservice/m-p/812716#M60</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jake&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you this workaround works!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2015 14:02:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoanalytics-server-questions/delete-features-from-featureservice/m-p/812716#M60</guid>
      <dc:creator>ChristianSailer2</dc:creator>
      <dc:date>2015-08-31T14:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Delete features from featureservice</title>
      <link>https://community.esri.com/t5/arcgis-geoanalytics-server-questions/delete-features-from-featureservice/m-p/812717#M61</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I successfully deleted over 100,000 records from a hosted feature layer using the REST Delete Features tool by way of putting 1=1 in the where clause (and nothing in the Object ID field), BUT I did this in my organization's Portal 10.7.1 environment; so, ArcGIS Online might limit how many can be deleted due to cloud resource usage...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*I'm also posting to thank Chris for the 1=1 in where syntax help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image" height="453" src="https://community.esri.com/legacyfs/online/512669_Capture.PNG" width="597" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2020 14:55:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoanalytics-server-questions/delete-features-from-featureservice/m-p/812717#M61</guid>
      <dc:creator>RossCBrewer</dc:creator>
      <dc:date>2020-11-06T14:55:05Z</dc:date>
    </item>
  </channel>
</rss>

