Since ArcGIS OnLine doesn't allow for boolean fields, I'm creating a domain that will contain "Yes" or "No" (to be used in a form within Field Maps).
Is there any way to create one domain on AGOL and then reuse it (possibly by calling its name)?
// first declare a domain
"fields": [
{
"name": "field",
"type": "esriFieldTypeString",
"alias": "field",
"sqlType": "sqlTypeOther",
"length": 3,
"nullable": true,
"editable": true,
"domain": {
"type": "codedValue",
"name": "DomField",
"mergePolicy": "esriMPTDefaultValue",
"splitPolicy": "esriSPTDefaultValue",
"codedValues": [
{"name": "Yes", "code": 1},
{"name": "No", "code": 0}
]
},
"defaultValue": null
}
]
// then reuse field when adding or updating layer definition and the field would inherit the domain values "Yes" and "No" and codes
"fields": [
{
"name": "field2",
"domain": {
"name": "DomField"
}
}
]