How do I make a "required" field?

12272
6
07-21-2016 02:58 PM
DavidGundlach1
New Contributor

Want to make some fields required when data is being collected; i.e. should not be able to complete edit ( or Submit) without these fields having data entered

The fields in question do have domains and it looks like that may prevent it being required somehow. The original feature class has "No" in the Allow Null Values property for these fields, but in Collector that may only work for fields without domains?

6 Replies
DanPatterson_Retired
MVP Emeritus

https://community.esri.com/ideas/10007 actually, they give the method to make the fields required there.. by not allowing nulls.... I think

0 Kudos
DavidGundlach1
New Contributor

Hi Dan - thanks for the reply. The fields in question do have domains and it looks like that may prevent it being required somehow. The original feature class has "No" in the Allow Null Values property for the fields of interest , but in Collector that may only work for fields without domains?

0 Kudos
DanPatterson_Retired
MVP Emeritus

don't know, and I can find no references except for ArcGIS Ideas links... sorry, perhaps someone from the Collector Collective will weight in

0 Kudos
ScottFierro2
Occasional Contributor III

Currently there isn't an ESRI designed method for creating required fields. We have brought this up with them several times over the last year and they say it is in the works. In the meantime we have found an option that does work but ESRI tells us is not "by design". It will make the fields required though and the submit button is grayed out until all required fields are populated. Have a write up on this workaround if you want to e-mail me at scott.fierro@dot.ohio.gov I can pass it along to you. Just understand that at this time ESRI states this is a BUG workaround so something as simple as a future update may break this working or they may decide to use this as the workflow for creating required fields.

SerjStolyarov1
New Contributor III

Below will apply if you are using on premise ArcGIS Portal and own Geodatabase. 

Setting a Field to "Not Nullable" in the Geodatabase either when you create the Feature Class or modifying field properties afterwards, is correctly picked up by Collector for Windows. The fields will be highlighted as "Required" in RED and "Submit" button will be grayed out until the field has been populated. 

 

We have feature services published from ArcMap 10.5 into ArcGIS Server 10.5 which is federated with ArcGIS Portal 10.5

 

Collector for Windows 18.0.1

ArcGIS Portal 10.5

ArcGIS Server 10.5

Oracle Geodatabase 12g

 

Note though, if you already have records in the feature class and want to change a field into "Not Nullable", it will not be possible if there are records that already have "Null" present in that given field. You could use Field Calculator to replace all Nulls with a string or an integer depending on the field type. However, if you have Archiving Enabled, Field Calculator will not replace all the Nulls, as there are hidden archived records! To overcome this, I run an UPDATE query directly in the database management system SQL Developer, to replace all Null values with a string. After this you can set the field to "Not Nullable" in ArcCatalog.

CinthiaEichhorn
New Contributor III

Hi Serj,  How well does this work for views?  When I tried this on an empty file geodatabase (no data)  that I had published to AGO using the publish web layer in Pro and created a view and web map, the required fields did get picked up by Collector for a web.  But when I created a 2nd view and web map from that 2nd view, the required fields did not work correctly with the date going back to 1899, and 0s in some of the required fields.  There was not any data in the feature service.  Is this possibly a workflow issue?

0 Kudos