Hosted Feature Services in Portal/AGOL seem to create feature records without respecting the data model behind the feature class. Please fix this functionality so the platform does not commit a database record unless all constraints are dealt with by the user. At this time both Portal and AGOL platform's allow the creation of feature records when NOT NULL constraints exist. This defeats the purpose of data integrity and the very reason we want to set NOT NULL constraints.
Feature Class definition - prior to publish Hosted Feature Layer
The current experience is ArcGIS Online will prompt the user for fields which are NOT NULL with an exclamation icon indicating the value is required, however the user can just close the window and the record is saved. The result is a "space" is saved in the NOT NULL field. This goes around the entire data model and is not desirable as it leads to messy data collections and allowing users to by pass required fields. Granted they could type a space in as well but the platform should not do this by default.
The experience is the same in Portal 10.5 except it does not show the exclamation point to the user in the fields window.
Tracing the activity in Portal shows the record is actually created in the database once geometry is defined (applyEdits) and then an edit window pops up for the end user which then passes another applyEdits. Querying the hosted feature service rest end point shows the records are being created with spaces in the NOT NULL fields even if the user does not interact with the feature.
Please fix this so no records are saved in the database unless a user has completed entering values, do not bypass NOT NULL fields with automatic space values which by passes the feature class field constraints.