Using File Geodatabase coded domain with ArcGIS Online?
Zip and upload is not going to work. As it says at the bottom of hypelink you have to share your MAP as feature service.
I followed the steps in an ESRI blog which shows how to add a domain through the REST API.
Direct link to the document: click me
Here's what I put to add a Yes/No domain to a field called Completed:
{
"name": "Completed",
"type": "esriFieldTypeString",
"alias": "Completed",
"sqlType": "sqlTypeOther",
"length": 50,
"nullable": true,
"editable": true,
"domain": {
"type": "codedValue",
"name": "Completed",
"codedValues": [
{
"name": "Yes",
"code": "Yes"
},
{
"name": "No",
"code": "No"
}
]
},
"defaultValue": null
}
I tested it out in the Collector app, and it works great.
There is a gotcha though. You need to change the “lastEditDate” line to be empty quotes or it throws an error when you hit the Update Layer Definition button.
So put:
“lastEditDate” : “”
And it should submit successfully.