Select to view content in your preferred language

Error using append method from ArcGIS API for Python

3454
10
07-07-2022 06:07 AM
JosephHilliard94
Regular Contributor

Hi there,

I have been trying to append from one feature layer to another using the ArcGIS API for Python. I get the below error message? 

Exception: Object reference not set to an instance of an object.
(Error Code: 400)

My code is below:

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"},
{"name" : "SPECIES","sourceName" : "species"},{"name" : "USAGEZONE","sourceName" : "usagezone"},{"name" : "TREEREF","sourceName" : "treeref"},
{"name" : "AGE","sourceName" : "age"},{"name" : "GIRTH","sourceName" : "girth"},{"name" : "TREETYPE","sourceName" : "treetype"},{"name" : "PROPREF","sourceName" : "propref"},
{"name" : "SITEINFORMATION","sourceName" : "siteinformation"},{"name" : "TREEINFORMATION","sourceName" : "treeeinformation"},{"name" : "TREECOMMENTS","sourceName" : "treeinformation"},
{"name" : "GLOBALID","sourceName" : "globalid"},{"name" : "CREATED_USER","sourceName" : "created_user"},{"name" : "CREATED_DATE","sourceName" : "created_date"},
{"name" : "LAST_EDITED_USER","sourceName" : "last_edited_user"},{"name" : "LAST_EDITED_DATE","sourceName" : "last_edited_date"}])

 

Any help would be great as this never works for me!

Joe

0 Kudos
10 Replies
dns
by
Occasional Contributor

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.

0 Kudos