Datefields cannot be forced to be null

03-08-2021 01:45 AM
New Contributor II


I have made a Survey in S123 connect based on a current feature service, where the user should be able to change 3 different date fields (among other fields).

To make it more user friendly, i have made 4 buttons in an experience environment, where the date fields would be either today's date or null, as the 3 fields are connected (Reservation date, when the reservation will expire, and the date when the property is sold)

When there is a new reservation, the user will click the "Reservation" button, and the "Sold date" will become null, "Reservation" will be today's date, and "Reservation expires" will be today's date + 6 months.

My issue:

When the button is clicked, the following is hard coded into the Survey 123 link:


This hardcoded link results in the following survey, where the "Solddate" would become null (Which works as intended): - Translated from Danish (Sorry)



However, when you click the submit button i get the following error:


Which i would roughly translate into: "The survey contain errors: 1. Click here to navigate to each error".

So for some reason it is not possible to send Null data to a datefield? Does anybody know why? - The field(s) can contain Null values in the database. The 3 date fields all have the bind::esri:fieldType of esriFieldTypeDate in the S123 excel spreadsheet.

0 Kudos
2 Replies
Esri Notable Contributor

Did you try removing &field:Solddate=null completely from your link?

If you do not set a default value in your date question, it will appear empty and if not completed by the user a null value will be stored in the feature layer.

0 Kudos
New Contributor II

That works completely fine, however, as the feature service is editable, the "&field:Solddate=null" was my way of trying to reduce the amount of clicks when editing the data. Therefore, if i don't set "solddate=null", the original date will still appear, if already set, and it would then have to be changed manually 🙂 

I want to be able to remove the original date stored in one of the date fields, without the user needing to delete/remove the data manually.

0 Kudos