Hi,
We are having problems when we want to update the field defintion on a featurelayer that is hosted on a featureservice in ArcGIS Online. We want to update the domain definition on multiple fields that uses the same domain.
Domain defintion:
"domain": {
"type": "codedValue",
"name": "YESNO",
"mergePolicy": "esriMPTDefaultValue",
"splitPolicy": "esriSPTDefaultValue",
"codedValues": [
{
"name": "No",
"code": "1"
},
{
"name": "Yes",
"code": "2"
}
]
}This domain is used on multiple fields in a feature layer that is hosted in ArcGIS Online.
We call the update_definition in Python like this:
from arcgis.gis import GIS
import arcgis
import json
gis = GIS([AGOLURL], [USER], [PWD])
fs = arcgis.features.FeatureLayer([FeatureServiceURL], gis)
update_dict = json.loads(...json field defintion...)
check = fs.manager.update_definition(update_dict)
JSON field defintion:
"fields": [
{
"name": "field1",
"domain": {
"type": "codedValue",
"name": "YESNO",
"mergePolicy": "esriMPTDefaultValue",
"splitPolicy": "esriSPTDefaultValue",
"codedValues": [
{
"name": "No",
"code": "1"
},
{
"name": "Yes",
"code": "2"
}
]
}
},
{
"name": "field2",
"domain": {
"type": "codedValue",
"name": "YESNO",
"mergePolicy": "esriMPTDefaultValue",
"splitPolicy": "esriSPTDefaultValue",
"codedValues": [
{
"name": "No",
"code": "1"
},
{
"name": "Yes",
"code": "2"
}
]
}
},
{
"name": "field3",
"domain": {
"type": "codedValue",
"name": "YESNO",
"mergePolicy": "esriMPTDefaultValue",
"splitPolicy": "esriSPTDefaultValue",
"codedValues": [
{
"name": "No",
"code": "1"
},
{
"name": "Yes",
"code": "2"
}
]
}
}
] The result from that call is SUCCESS and it updates all fields.
BUT the name of the domain for each field changes from what I except "YESNO" to field1_[number], field2_[number], and so on.
Does anyone have some input how to solve this? or if I am missing something. I have checked that we dont have missed out any fields in the feaure layer that uses the same domain.
We have ArcGIS Pro 3.1.3 installed at the moment.