Select to view content in your preferred language

Force a feature service view to refresh after changes to parent feature service

825
1
10-30-2019 11:29 PM
AnthonyCheesman1
Frequent Contributor

(Cross-posted in ArcGIS REST API)

Hi everyone

I've got a project that consists of a master feature service that is updated by an external process, and several layer views from the parent FS.

I've had to make some updates to the project due to some upstream changes, which has resulted in some schema and symbology changes to the parent FS.

I am wondering - is there a straightforward way (programmatic or otherwise) thatI can force these changes on the downstream feature services without having to delete and re-create the view?

Feature service and views are hosted in ArcGIS Online organisational account.

Very interested to hear what the options are.

Thanks - Anthony

Tags (3)
0 Kudos
1 Reply
by Anonymous User
Not applicable

Hi Anthony Cheesman‌,

You should be able to use updateDefinition for this to accomplish it programatically: Update Definition (Feature Service)—ArcGIS REST API: Services Directory | ArcGIS for Developers 

In the below example (just did it through the GUI and captured the request) I had added a new field to the parent Feature Service and the following was passed as the fields parameter when I added the new field to the existing view:

{
"fields": [{
"name": "OBJECTID",
"visible": true
}, {
"name": "CODEDTEXT",
"visible": true
}, {
"name": "FreeText_",
"visible": false
}, {
"name": "Shape__Area",
"visible": true
}, {
"name": "Shape__Length",
"visible": true
}, {
"name": "SchemaChange1",
"visible": true
}
]
}

If you don't have too many views you may be better off updating them manually from the Visualization > Set View Definition interface. 

Hope this helps,

-Peter

0 Kudos