Joining structured array to a table using ExtendTable function fails?

249
1
10-16-2020 08:30 AM
NateWold
New Contributor II

When using the arcpy.da.ExtendTable() function to join the contents of a NumPy structured array to a hosted feature layer based on a common attribute field "geography" it fails with the message below.  I am trying to join an array to a table that has identical field names. I want to update existing fields that have the same name as those in the array which is why append_only = False.

Any help or suggestions on other methods to perform this operation would be appreciated.

array = yearCollect.to_records()


feature_service_itemID = "9656cfce75354d88b4c88eca3aa9661e"
item = gis.content.get(feature_service_itemID)
lyr = item.layers[0]
output = lyr.url


arcpy.da.ExtendTable(output, 
                     "NAMELABEL", 
                     array, 
                     "geography",
                    append_only = False)‍‍‍‍‍‍‍‍‍‍‍‍‍‍


---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-22-545d38bf9e46> in <module>
      3                      array,
      4                      "geography",
----> 5                     append_only = False)

RuntimeError: The user does not have permission to execute the operation.
0 Kudos
1 Reply
DanPatterson
MVP Esteemed Contributor

Just a thought.  ExtendTable makes permanent changes to the featureclass/table.  Do you have permissions to do so?


... sort of retired...
0 Kudos