Select to view content in your preferred language

Resetting Feature Template Default Values to Enforce Required Fields

534
0
08-23-2021 02:44 PM
MachielVan
Occasional Contributor

A helpful tip for enforcing Required Fields when publishing Feature Services to ArcGIS Online:

For any Feature Layers that uses fields that do not allow null values ("Required Fields") and do not also use a list of coded domain values, it's important to know that you must reset the default values in the feature template of the Feature Layer to null in order for the fields to actually require a user-input response. This can be achieved by the Item's owner by entering the administrative mode in the REST directory (typing "admin" between the "rest/" and "/services" portions of the URL, selecting "Update Definition". You can search for the portions of the code that contains "templates", then reset the default spaces, zeroes and dates to "null".

This must be executed prior to any records being entered into the data table. If you neglect this step, you'll notice that the feature templates will contain a zero value for any integer or double fields, a space for any string fields, and a default dateTime for any dateTime fields. 

Tags (1)
0 Kudos
0 Replies