<?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: Python API Bug? arcgis.features.FeatureLayer.edit_features(adds=[ftSet_array]) throws 10500 Error in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/python-api-bug-arcgis-features-featurelayer-edit/m-p/1264030#M26745</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/10527"&gt;@JakeSkinner&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/433412"&gt;@Kepa&lt;/a&gt;&amp;nbsp; this was the original method I attempted for this process, but it is not available in Enterprise 10.8.1, only in ArcGIS Online. When I attempted the ArcGIS API for Python append method, I got the error&amp;nbsp;&lt;STRONG&gt;Exception('Append only available on ArcGIS Online.')ERROR:root:Append only available on ArcGIS Online.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;When using the arcpy.management.Append() method, the process works if ArcGIS Pro is manually signed into at run time- it even works if ArcGIS Pro is closed out then the script is run shortly after. But this needs to be a scheduled process, and when it's run as a service after hours, it fails on the arcpy append step saying that the target feature service is unavailable or unsupported (even though a truncate step using the ArcGIS API for Python truncate successfully runs on that same service prior to that failure).&amp;nbsp;&lt;/P&gt;&lt;P&gt;So does this mean that both append and edit_features are unavailable options in Portal? The edit_features() method I used in the code posted above works great and is super efficient in ArcGIS Online (it consistently took about 2 minutes to append 100,000 points). I'd love to use it in Portal, too if possible...&lt;/P&gt;</description>
    <pubDate>Fri, 03 Mar 2023 16:39:34 GMT</pubDate>
    <dc:creator>EmmaHatcher</dc:creator>
    <dc:date>2023-03-03T16:39:34Z</dc:date>
    <item>
      <title>Python API Bug? arcgis.features.FeatureLayer.edit_features(adds=[ftSet_array]) throws 10500 Error</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-api-bug-arcgis-features-featurelayer-edit/m-p/1263860#M26742</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to automate updates of a hosted feature service in Portal 10.8.1. I have a method to convert the feature class to a feature set, then pass the array of features from that feature set to the arcgis.features.FeatureLayer.edit_features(adds=[ftSet_array]). This function when run using a Portal feature service doesn't append any data. When I print the edit result, I see the following message:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;{'addResults': [{'objectId': None, 'success': False, 'error': {'code': 10500, 'description': 'class org.json.JSONObject cannot be cast to class com.esri.core.geometry.Geometry (org.json.JSONObject and com.esri.core.geometry.Geometry are in unnamed module of loader java.net.URLClassLoader @614ddd49)'}}], 'updateResults': [], 'deleteResults': [], 'attachments': {'addResults': [], 'updateResults': [], 'deleteResults': []}}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The exact same script/code works and appends the data as expected and incredibly fast/efficiently on a copy of the hosted feature service in ArcGIS Online.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the snippet below, I converted a feature class to a feature set called add_features.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;adds_array = []
        for a in add_features:
            adds_array.append(a)

        total_adds = len(adds_array)
        if total_adds &amp;gt; 10000:
            print_to_stdout("Incrementally appending new data...")
            n = 10000
            inc_adds_array = [adds_array[i * n:(i + 1) * n] for i in range((len(adds_array) + n - 1) // n )]
            for lst in inc_adds_array:
                #print(lst)
                edit_result = target_ftlyr.edit_features(adds=lst)
                print("Edits summary: {0}".format(edit_result))
            print("{0} total features successfully added to the feature service!".format(total_adds))
        else:
            edit_result = target_ftlyr.edit_features(adds=adds_array)
            print({0} total features successfully added to the feature service!".format(str(len(adds_array))))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is the FeatureLayer.edit_features() only available in ArcGIS Online?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2023 19:47:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-api-bug-arcgis-features-featurelayer-edit/m-p/1263860#M26742</guid>
      <dc:creator>EmmaHatcher</dc:creator>
      <dc:date>2023-03-03T19:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: Python API Bug? arcgis.features.FeatureLayer.edit_features(adds=[ftSet_array]) throws 10500 Error</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-api-bug-arcgis-features-featurelayer-edit/m-p/1263918#M26743</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/262560"&gt;@EmmaHatcher&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I think in terms of efficiency I wouldn't go through the feature class to feature set conversion. You just can call &lt;EM&gt;append&lt;/EM&gt; method from the &lt;EM&gt;FeatureLayer&lt;/EM&gt; object uploading the feature class directly. If I'm not mistaken it's supported since version 10.8.1.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2023 09:10:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-api-bug-arcgis-features-featurelayer-edit/m-p/1263918#M26743</guid>
      <dc:creator>Kepa</dc:creator>
      <dc:date>2023-03-03T09:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Python API Bug? arcgis.features.FeatureLayer.edit_features(adds=[ftSet_array]) throws 10500 Error</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-api-bug-arcgis-features-featurelayer-edit/m-p/1263936#M26744</link>
      <description>&lt;P&gt;Hi Emma,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I second Kepa's idea of using the append method.&amp;nbsp; Take a look at the following script.&amp;nbsp; It may give you what you need.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-online-documents/overwrite-arcgis-online-feature-service-using/ta-p/904457" target="_blank"&gt;https://community.esri.com/t5/arcgis-online-documents/overwrite-arcgis-online-feature-service-using/ta-p/904457&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2023 11:39:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-api-bug-arcgis-features-featurelayer-edit/m-p/1263936#M26744</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2023-03-03T11:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: Python API Bug? arcgis.features.FeatureLayer.edit_features(adds=[ftSet_array]) throws 10500 Error</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-api-bug-arcgis-features-featurelayer-edit/m-p/1264030#M26745</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/10527"&gt;@JakeSkinner&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/433412"&gt;@Kepa&lt;/a&gt;&amp;nbsp; this was the original method I attempted for this process, but it is not available in Enterprise 10.8.1, only in ArcGIS Online. When I attempted the ArcGIS API for Python append method, I got the error&amp;nbsp;&lt;STRONG&gt;Exception('Append only available on ArcGIS Online.')ERROR:root:Append only available on ArcGIS Online.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;When using the arcpy.management.Append() method, the process works if ArcGIS Pro is manually signed into at run time- it even works if ArcGIS Pro is closed out then the script is run shortly after. But this needs to be a scheduled process, and when it's run as a service after hours, it fails on the arcpy append step saying that the target feature service is unavailable or unsupported (even though a truncate step using the ArcGIS API for Python truncate successfully runs on that same service prior to that failure).&amp;nbsp;&lt;/P&gt;&lt;P&gt;So does this mean that both append and edit_features are unavailable options in Portal? The edit_features() method I used in the code posted above works great and is super efficient in ArcGIS Online (it consistently took about 2 minutes to append 100,000 points). I'd love to use it in Portal, too if possible...&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2023 16:39:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-api-bug-arcgis-features-featurelayer-edit/m-p/1264030#M26745</guid>
      <dc:creator>EmmaHatcher</dc:creator>
      <dc:date>2023-03-03T16:39:34Z</dc:date>
    </item>
  </channel>
</rss>

