<?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: Error using append method from ArcGIS API for Python in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/error-using-append-method-from-arcgis-api-for/m-p/1307678#M53340</link>
    <description>&lt;P&gt;Doesn't work for me either. Have checked every parameter and compared to how AGO does this on the backend, where it works fine. I am using the exact same parameters as a web browser would, which leads me to believe it's a bug in Esri's Python API. I hope they are actually looking at a thread like this. I can confirm I am using the actual item id string and that is not the problem.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jul 2023 16:50:47 GMT</pubDate>
    <dc:creator>dns</dc:creator>
    <dc:date>2023-07-12T16:50:47Z</dc:date>
    <item>
      <title>Error using append method from ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-using-append-method-from-arcgis-api-for/m-p/1190335#M46852</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I have been trying to append from one feature layer to another using the ArcGIS API for Python. I get the below error message?&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;Exception&lt;/SPAN&gt;: Object reference not set to an instance of an object.
(Error Code: 400)&lt;/PRE&gt;&lt;P&gt;My code is below:&lt;/P&gt;&lt;P&gt;archive_trees.append(item_id=lyr,upload_format='featureCollection',source_table_name='Felled_Trees',upsert=False,update_geometry=True,field_mappings=[{"name" : "OBJECTID","sourceName" : "OBJECTID"},{"name" : "PROPERTY","sourceName" : "property"},{"name" : "LOCATION_DETAILS","sourceName" : "location_details"},&lt;BR /&gt;{"name" : "SPECIES","sourceName" : "species"},{"name" : "USAGEZONE","sourceName" : "usagezone"},{"name" : "TREEREF","sourceName" : "treeref"},&lt;BR /&gt;{"name" : "AGE","sourceName" : "age"},{"name" : "GIRTH","sourceName" : "girth"},{"name" : "TREETYPE","sourceName" : "treetype"},{"name" : "PROPREF","sourceName" : "propref"},&lt;BR /&gt;{"name" : "SITEINFORMATION","sourceName" : "siteinformation"},{"name" : "TREEINFORMATION","sourceName" : "treeeinformation"},{"name" : "TREECOMMENTS","sourceName" : "treeinformation"},&lt;BR /&gt;{"name" : "GLOBALID","sourceName" : "globalid"},{"name" : "CREATED_USER","sourceName" : "created_user"},{"name" : "CREATED_DATE","sourceName" : "created_date"},&lt;BR /&gt;{"name" : "LAST_EDITED_USER","sourceName" : "last_edited_user"},{"name" : "LAST_EDITED_DATE","sourceName" : "last_edited_date"}])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be great as this never works for me!&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 13:07:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-using-append-method-from-arcgis-api-for/m-p/1190335#M46852</guid>
      <dc:creator>JosephHilliard94</dc:creator>
      <dc:date>2022-07-07T13:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Error using append method from ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-using-append-method-from-arcgis-api-for/m-p/1190344#M46853</link>
      <description>&lt;P&gt;Hi Joe,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Commonly, this error can occur when trying to Append data from one feature layer to another based on one of the following:&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;There are duplicate field values in the field used as the matching field to append the hosted feature layer.&lt;/LI&gt;&lt;LI&gt;The field values in the dataset exceed the character limit of the matching field of the hosted feature layer.&lt;/LI&gt;&lt;LI&gt;The file geodatabase appended in ArcGIS Online is not recognised.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;BR /&gt;Could you please review the following Technical Article Solutions and confirm if any of these options help to resolve the issue you are seeing? --&amp;gt;&amp;nbsp;&lt;A href="https://support.esri.com/en/Technical-Article/000025195" target="_blank"&gt;https://support.esri.com/en/Technical-Article/000025195&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 13:33:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-using-append-method-from-arcgis-api-for/m-p/1190344#M46853</guid>
      <dc:creator>MCameron</dc:creator>
      <dc:date>2022-07-07T13:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: Error using append method from ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-using-append-method-from-arcgis-api-for/m-p/1190389#M46856</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I have checked:&lt;/P&gt;&lt;UL class="lia-list-style-type-circle"&gt;&lt;LI&gt;&amp;nbsp;The target dataset is empty so there can't be an a duplicate value in the FID.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Field values do not exceed character limit (same append works using ArcGIS Pro just not on API).&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;File Geodatabase has successfully created the feature layer.&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Upsert is set to False as sync is enabled, can you offer any other solutions? I tried with a one feature append using the same schema and didn't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 14:59:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-using-append-method-from-arcgis-api-for/m-p/1190389#M46856</guid>
      <dc:creator>JosephHilliard94</dc:creator>
      <dc:date>2022-07-07T14:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: Error using append method from ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-using-append-method-from-arcgis-api-for/m-p/1190400#M46857</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/572139"&gt;@JosephHilliard94&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Make sure the item_id parameter is set to an actual item id and not just pointing to an object like a layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 15:27:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-using-append-method-from-arcgis-api-for/m-p/1190400#M46857</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2022-07-07T15:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Error using append method from ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-using-append-method-from-arcgis-api-for/m-p/1190411#M46860</link>
      <description>&lt;P&gt;I have tried that as well, no dice, thanks though!&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 15:39:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-using-append-method-from-arcgis-api-for/m-p/1190411#M46860</guid>
      <dc:creator>JosephHilliard94</dc:creator>
      <dc:date>2022-07-07T15:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: Error using append method from ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-using-append-method-from-arcgis-api-for/m-p/1190430#M46861</link>
      <description>&lt;P&gt;Hi Joe,&lt;/P&gt;&lt;P&gt;When you are calling "lyr", is this an item in your ArcGIS Online? If so, could you update item_id=lyr.id in the following line to include .id:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;archive_trees.append(item_id=lyr&lt;/SPAN&gt;&lt;STRONG&gt;.id&lt;/STRONG&gt;&lt;SPAN&gt;,upload_format='featureCollection',source_table_name='Felled_Trees',upsert=False,update_geometry=True,field_mappings=[....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Based on the ArcGIS API for Python &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html#arcgis.features.FeatureLayer.append" target="_self"&gt;Append documentation&lt;/A&gt; this would be required. Or you could use the item id reference which can be found in the URL of the layers item description page:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Item ID - ArcGIS Online.PNG" style="width: 604px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/45451i8562369DFE357B4F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Item ID - ArcGIS Online.PNG" alt="Item ID - ArcGIS Online.PNG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 16:02:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-using-append-method-from-arcgis-api-for/m-p/1190430#M46861</guid>
      <dc:creator>MCameron</dc:creator>
      <dc:date>2022-07-07T16:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Error using append method from ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-using-append-method-from-arcgis-api-for/m-p/1190442#M46862</link>
      <description>&lt;P&gt;I think I've only ever got the append to work with a CSV &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Alternatively, if the source data being appended had the same schema as the target you can convert a &lt;FONT face="courier new,courier"&gt;FeatureCollection&lt;/FONT&gt; to a &lt;FONT face="courier new,courier"&gt;FeatureSet&lt;/FONT&gt; and use&amp;nbsp; &lt;FONT face="courier new,courier"&gt;FeatureLayer.edit_features(add=feature_set)&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis import GIS
from arcgis.features import FeatureCollection

agol = GIS("home")

## Feature Collection object
fc = agol.content.get("**FC_Item_ID**")
fc = FeatureCollection.fromitem(fc)

## get as FeatureSet
fc_set = fc.query()

## feature service containing the target layer
fs = agol.content.get("**FS_Item_ID"**)

## target layer
lyr = fs.layers[0]

## add in the feature set, will return a dictionary with successful/unsuccessful results
print(lyr.edit_features(adds=fc_set))&lt;/LI-CODE&gt;&lt;P&gt;I know that doesn't help you now, but might help plan for/be useful in the future.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 16:23:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-using-append-method-from-arcgis-api-for/m-p/1190442#M46862</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2022-07-07T16:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Error using append method from ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-using-append-method-from-arcgis-api-for/m-p/1190816#M46876</link>
      <description>&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;Still not working sadly, it is possible for me to PM you my script for you to have a look?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 14:10:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-using-append-method-from-arcgis-api-for/m-p/1190816#M46876</guid>
      <dc:creator>JosephHilliard94</dc:creator>
      <dc:date>2022-07-08T14:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Error using append method from ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-using-append-method-from-arcgis-api-for/m-p/1191579#M46925</link>
      <description>&lt;P&gt;This is what I got up to and same error message:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Selection of Felled Trees&lt;/P&gt;&lt;P&gt;item = tsm_trees.query(where="TREETYPE='FEL'")&lt;/P&gt;&lt;P&gt;sdf = item.sdf&lt;/P&gt;&lt;P&gt;#Convert SDF to Feature Layer&lt;BR /&gt;lyr = sdf.spatial.to_featurelayer(sdf, folder='TSM')&lt;/P&gt;&lt;P&gt;NOTE - Tried GDB and Feature Layer here&amp;nbsp;&lt;/P&gt;&lt;P&gt;GDB = "194etc"&lt;/P&gt;&lt;P&gt;geodatabase = gis.content.get(GDB)&lt;/P&gt;&lt;P&gt;new_input = geodatabase.id&lt;/P&gt;&lt;P&gt;FEATURE_LAYER = "f14etc"&lt;/P&gt;&lt;P&gt;fcl = gis.content.get(FEATURE_LAYER)&lt;/P&gt;&lt;P&gt;new_fcl = fcl.id&lt;/P&gt;&lt;P&gt;#Append Data Appended Feature Layer -&lt;/P&gt;&lt;P&gt;archive_trees.append(item_id=new_input,upload_format='filegdb',source_table_name='Felled_Trees',upsert=False)&lt;/P&gt;&lt;P&gt;NOTE: Upsert has to be false as sync is enabled and doesn't work when I turn it off.&amp;nbsp;&lt;/P&gt;&lt;P&gt;A solution would be grand as this is a common workflow for us.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 15:25:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-using-append-method-from-arcgis-api-for/m-p/1191579#M46925</guid>
      <dc:creator>JosephHilliard94</dc:creator>
      <dc:date>2022-07-12T15:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: Error using append method from ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-using-append-method-from-arcgis-api-for/m-p/1219423#M48239</link>
      <description>&lt;P&gt;We were running into this problem as well when trying to append a spatially-enabled dataframe to an existing layer in a feature service. I don't know if this will help Joe, but I figured I'd put it here for anyone else who gets here from Google.&lt;/P&gt;&lt;P&gt;Our workflow involved getting the live data from the feature service as a dataframe, inserting new rows, truncating the existing data from the feature service, and then using .append to write the new, enlarged dataframe to the feature service using the following code. We kept hitting the "Object reference not set..." error (which, digging through the API source, is coming from the method that keeps checking the status of the operation).&lt;/P&gt;&lt;LI-CODE lang="python"&gt;geojson = dataframe.spatial.to_featureset().to_geojson
result, messages = target_featurelayer.append(
    upload_format='geojson',
    edits=geojson,
    upsert=False,
    return_messages=True,
    rollback=True
)&lt;/LI-CODE&gt;&lt;P&gt;My coworker had the thought of checking for and removing all Nulls/NaNs in the dataframe, and this seems to have solved the problem. Any numeric columns with np.nan were set to 0 (which makes sense in this one use case; in the future, I may use -999 or something like that) and any text values were set to empty strings.&lt;/P&gt;&lt;P&gt;His dataset is now uploading as it ought to, so it may be that somewhere in the featureset/geojson/append pipeline it really doesn't like null values.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 16:11:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-using-append-method-from-arcgis-api-for/m-p/1219423#M48239</guid>
      <dc:creator>JakeAdamsUGRC</dc:creator>
      <dc:date>2022-10-06T16:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Error using append method from ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-using-append-method-from-arcgis-api-for/m-p/1307678#M53340</link>
      <description>&lt;P&gt;Doesn't work for me either. Have checked every parameter and compared to how AGO does this on the backend, where it works fine. I am using the exact same parameters as a web browser would, which leads me to believe it's a bug in Esri's Python API. I hope they are actually looking at a thread like this. I can confirm I am using the actual item id string and that is not the problem.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 16:50:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-using-append-method-from-arcgis-api-for/m-p/1307678#M53340</guid>
      <dc:creator>dns</dc:creator>
      <dc:date>2023-07-12T16:50:47Z</dc:date>
    </item>
  </channel>
</rss>

