When I look at my existing fields, I have a couple with the type as "Small Integer"
However when I try to add a new field it does not give me the option for a "Small Integer". I see "Big Integer" and regular "Integer"
I can work around this by making the changes locally and republishing, but I am hoping that there is a simpler way to do it directly online.
NOTE: the solution says to drill down into the layer before clicking on Admin. I had to do it the other way around because Admin would disappear when I had clicked on the layer name. But it did work in the end!
Solved! Go to Solution.
If I need to add a small integer field to a service, I usually do so using the REST services directory's admin page. In case you haven't used this before, you can do this:
{"fields": [{
"name" : "MyNewField",
"type" : "esriFieldTypeSmallInteger",
"alias": "My New Field",
"nullable": true,
"editable" : true,
"visible" : true
}]}
You should get a page saying the operation was successful and your new field should be on the layer.
If I need to add a small integer field to a service, I usually do so using the REST services directory's admin page. In case you haven't used this before, you can do this:
{"fields": [{
"name" : "MyNewField",
"type" : "esriFieldTypeSmallInteger",
"alias": "My New Field",
"nullable": true,
"editable" : true,
"visible" : true
}]}
You should get a page saying the operation was successful and your new field should be on the layer.
I may have deviated slightly, here is how and why:
Everything else seemed correct, but it didn't seem to work. unless it takes a while to propagate the change?
The change should be immediate, no time to propagate.
There are two "Add to Definition" pages, one that is used to modify the service and one that's used to modify a specific layer or table within the service. It sounds like you got the wrong one; the service-level one would be used to do something like add a new sublayer or table to the service (you can do all sorts of cool things through these interfaces that you can't do through the standard web interface), whereas the layer/table-level one is what you need to call to add a field or an index. If you tried to add a field at the service level, I expect nothing would happen but it wouldn't give you an error, either.
If your service only consists of one layer, you should still go down to the sublayer page; otherwise you're working with the service and not a layer.
Finally got back to this.
What threw me off was that I had to click admin before clicking on the layer. If I clicked the layer first, then the Admin link would disappear.
So it worked. Thanks!
Also now I have to dig into this REST stuff and see what other nifty tricks can be done with it!