<?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: Editing a Hosted Feature Service with Python in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/editing-a-hosted-feature-service-with-python/m-p/416384#M20847</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I haven't coded a solution to this, but thought this might help. There are some tools in the &lt;/SPAN&gt;&lt;A href="https://github.com/Esri/geoprocessing-tools-for-hadoop"&gt;Geoprocessing tools for Hadoop&lt;/A&gt;&lt;SPAN&gt; that convert 'features to json' and 'json to features'. You could use this to exchange the actual data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that helps,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Andrew&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Nov 2013 20:28:18 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2013-11-07T20:28:18Z</dc:date>
    <item>
      <title>Editing a Hosted Feature Service with Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/editing-a-hosted-feature-service-with-python/m-p/416383#M20846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to arrive at a methodology that will allow us to edit features (actually download and then delete) from a hosted feature service in ArcGIS Online using a scheduled python script. After some browsing the forums I see some solutions that use highly customised methods to call the REST api etc. However, what I can looking for is a method that uses arcpy and not lots of custom code. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In ArcGIS 10.1, if I sign in to ArcGIS Online and add the feature service to an ArcMap document, then I can open a cursor (either arcpy.searchcursor or arcpy.da.searchcursor) on a layer in the feature service in the command line window and access the rows (features). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For Example: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;featCur = arcpy.SearchCursor(r"myFeatureServiceLayerName")
for feat in featCur:
&amp;nbsp; print str(feat.getValue("OBJECTID"))
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This seems to be close to being the correct solution. However, if I save the layer in the mxd to a layer file and try to open a cursor from outside ArcMap (i.e. in ArcCatalog command line) by using the layer file as input, I get the following error: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color:#FF0000;"&gt;ERROR 999999: Error executing function.&lt;BR /&gt;Authentication token required.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This occurs whether or not I am signed in to ArcGIS Online. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Has anyone managed to get a similar script working with an online feature service? I cannot be the first person to want to script the download/update of features from a hosted feature service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any pointers most appreciated. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;John&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2013 14:47:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/editing-a-hosted-feature-service-with-python/m-p/416383#M20846</guid>
      <dc:creator>JohnFannon</dc:creator>
      <dc:date>2013-11-06T14:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Editing a Hosted Feature Service with Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/editing-a-hosted-feature-service-with-python/m-p/416384#M20847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I haven't coded a solution to this, but thought this might help. There are some tools in the &lt;/SPAN&gt;&lt;A href="https://github.com/Esri/geoprocessing-tools-for-hadoop"&gt;Geoprocessing tools for Hadoop&lt;/A&gt;&lt;SPAN&gt; that convert 'features to json' and 'json to features'. You could use this to exchange the actual data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that helps,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Andrew&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2013 20:28:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/editing-a-hosted-feature-service-with-python/m-p/416384#M20847</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-11-07T20:28:18Z</dc:date>
    </item>
  </channel>
</rss>

