Is it possible to make a field required after it is published?

647
3
01-02-2019 04:57 AM
by Anonymous User
Not applicable

Morning Everyone,

Is it possible to set the "allow null values" from true to false after the service is pubished? I went into the geojson and tried to update there but no dice. There is also no option to edit this function in AGO. Do I need to republish? 

Thanks

0 Kudos
3 Replies
DanPatterson_Retired
MVP Emeritus

republish

Modify field properties—Geodatabases | ArcGIS Desktop 

You can't even change a fc field after data are added to it

AndresCastillo
MVP Regular Contributor

Here is a possible workaround to that:

https://community.esri.com/thread/217206-how-to-use-smart-editor-to-require-user-to-populate-field

How to use Smart Editor to require user to populate field?

KhaledHassen
Esri Contributor

FYI: Currently you can change the followings field properties after it is published:

- Domain

- Alias

- Visibility

The way to change this properties through layer update definition API. /rest/admin/.../FeatureServer/<layerId>/updateDefinition

{

   "fields" : [

   {

        "name" : "myField",

        "alias" : <myalias>,

        "domain" : "...",

        "visible" : <true/false>

   }

  ]

}

We are currently working on allowing updating other properties including nullable, editable in the next release or so. Will be update you shortly if we can make it in March release of online.

Until we support this. You can always create an empty service and add a new empty layer with the new definition you need. You can then use the layer Append API to append the existing data you have (you would need to export the existing data to a filegdb or any other other format). 

Khaled