Saving Empty Date Fields to Retool Database (Revisit 2)

Hello @Ross_Coombes,

Thank you for this feedback. I completely agree, it should be as easy has passing in {{myForm.data}} and in a perfect world, users should not need to sanitize their data to replace "" with null values.

I believe the root cause of this problem is stemming from some very old and deeply embedded code from the early days of Retool, that to replace would involve a massive overhaul of the Form component.

For update queries to Retool DB, Joe's solution in the linked thread, of adding in a JS Query code block to delete or re-assign "" to be null and then pass the data from the JS Query block into the update query should work for most cases.

I understand it is tedious to do this for data objects that have multiple date time fields but it should produce consistent results.

I can make a feature request for having the logic to check for the form's date time input, to check for "" and replace it with a user inputted value to be set up as an embedded feature than users can toggle on and off for the component.

Although this may not solve the issue of points 3 and 4, as the initial may still be different from the data after something like a JS Query block replacement runs :thinking:

Could you share a screenshot of the field being set to null and then changing?

From my testing I am not able to change a date time input component's value to be null, but if the component is being set to null and then changing I can make a feature request for that as well. If the value cannot be assigned to null at all that could be another option for a feature request to allow it to be set as a non-string value.