Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit fields for adds/updates #28

Open
jacobdadams opened this issue Dec 13, 2022 · 5 comments
Open

Limit fields for adds/updates #28

jacobdadams opened this issue Dec 13, 2022 · 5 comments
Labels
enhancement New feature or request
Milestone

Comments

@jacobdadams
Copy link
Member

I can't figure out how to get the append_fields parameter to not throw Error 500 (unknown error)s. So for now, new dataframe fields must match existing fields. Later I can figure out how to get append_fields working properly (may need to chat w/Esri).

@jacobdadams jacobdadams added the enhancement New feature or request label Dec 13, 2022
@jacobdadams jacobdadams added this to the v3.1 milestone Dec 13, 2022
@steveoh
Copy link
Member

steveoh commented Dec 13, 2022

Where does append_fields get used?

@jacobdadams
Copy link
Member Author

It's listed in the FeatureLayer.append() arguments.

After a little more (inadvertent) testing, it looks like it doesn't throw the error if append_fields includes all the fields in the live layer (which negates the point of subsetting with append_fields...)

@steveoh
Copy link
Member

steveoh commented Dec 13, 2022

can this operation be done in the pro gui and exported to python to see what it's expecting?

@jacobdadams
Copy link
Member Author

I don't think so- this is ArcGIS API for Python, not arcpy. The "try the different/native form" check would be an HTTP post request using https://developers.arcgis.com/rest/services-reference/enterprise/append-feature-service-layer-.htm

@steveoh
Copy link
Member

steveoh commented Dec 14, 2022

so something like this example?

POST /webadaptor/rest/services/MyService/FeatureServer/0/append HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

sourceTableName=MyShapes&fieldMappings=[{"source":"myShapeDate","name":"datefield"},{"source":"myData","name":"mydata"},{"source":"myData2","name":"mydata2"},{"source":"FID","name":"objectid"}]&upsert=true&skipInserts=false&updateGeometry=true&appendFields=["datefield","mydata","mydata2","objectid"]&appendUploadId=62b7e088a2ff4b3da1a240d72f9994e3&appendUploadFormat=shapefile&rollbackOnFailure=true&f=json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants