Select to view content in your preferred language

problem update hosted feature in portal

1429
10
02-15-2023 06:23 AM
Labels (1)
OrrGvili
Occasional Contributor

trying to update hosted feature on ArcGIS Enterprise 10.8.1+ from local GDB 

this is the Exception
Exception: 'appendUploadFormat' must be one of the following: shapefile, geojson, csv, featureCollection, excel.

in the API  working with fgdb is option , 

this is the function i use for the update  what am i missing ? 

def append_and_update(agriplots,gdb, url,username,password):
    gis = GIS(url = url, username=username, password=password)
    layer_for_update = FeatureLayer(agriplots,gis)
    print("Uploading File Geodatabase")
    fgd_properties={'title':"Temp GDB deleted at the end", 'tags':'temp file geodatabase', 'type':'File Geodatabase'}
    gdb_item = gis.content.add(item_properties=fgd_properties, data=gdb + ".zip")
    print("updating... ")
    result = layer_for_update.append(item_id=gdb_item.id, upload_format="filegdb",source_table_name='AP_WGS84',return_messages=True)
    print(result)
    delete_result = gdb_item.delete()
    print(delete_result)
0 Kudos
10 Replies
LSaunders
Regular Contributor

Did you ever find a solution for this?

0 Kudos
AnthonyAtkins2
Occasional Contributor

I too am getting this error and I'm using a FGDB. Any help would be appreciated!

0 Kudos
AnthonyAtkins2
Occasional Contributor

You posted this back in February, so I'm wondering if you found a solution?  I haven't "officially" figured out why we are getting this message, but I have a strong hunch.  I bet you're logged into Portal as opposed to AGOL, right? I KNOW; why would there be a difference?  Well, when I run my script when connected to AGOL, it works perfectly, but when I'm connected to Portal, NOPE!

 

So, if someone from ESRI is reading this would you please explain why this is the case?  I'm still searching for a Portal solution (Unless you have Big Data and GeoAnalytics, the managed_data append method is out), so if someone knows of one, please let me/us know.

0 Kudos
NanaeAubry
Esri Contributor

Hello, sorry for a VERY late reply but we have no idea why this is occurring. 

We are looking into it and will post a solution here when we have one. In the meantime you can see the supported append formats on a feature layer (both online and enterprise) with:

`feature_layer.properties.supportedAppendFormats`

 

We don't know why only append formats are being supported on certain feature layers. But this is why you are seeing the error, the format is not supported.

0 Kudos
LSaunders
Regular Contributor

Portal will only allow me to do it with shapefiles...not great!

0 Kudos
JeredHansenNPS
New Contributor

Any updates on this error? ESRI documentation clearly states that file geodatabases are an acceptable format. We are still running Portal/Server 10.9.1. Potentially that is the source of the issue. 

0 Kudos
AiminFan1
Emerging Contributor

I am running 11.1 and got this error too

0 Kudos
MiguelVillafranca
New Contributor

Exactly the same issue here. ArcGIS enterprise 10.9.1 fails with "filegdb", although the documentation says it should work.

0 Kudos
NanaeAubry
Esri Contributor

We are looking at WHY only certain formats are supported but to see what formats are supported on the feature layer you can see it in the properties:

`feature_layer.properties.supportedAppendFormats`

 

This is more of an Enterprise/Online issue rather than Python API but we will update our error handling on this and also try to understand why.