I've read that it is normal for Retool to convert any null string values to the empty string when writing to the database.
But it is also doing this for a data value of type TIME.
It shows the conversion when I examine the component..
This is wrong, because empty string is not a valid value for data of type TIME and the database rejects it so the update or insert fails.
I have to work around this in the query by using...
value == ""? null : value;
But this shouldn't be necessary. null TIMEs should be left as null.
Hey there @davblo ,
Yeah, I feel your pain and, as you rightly mentioned, there have been several requests in the past years to change this. Just linking them here for visibility
Thank you for sharing the screen shot and explaining!
You are 100% correct the tooltip is indicating that the null value is being changed by the component to an empty string of "" and this is not easy to work with and is not what you want to be sending to your database.
I have filed a feature request to our engineering team and this change to allow the date time field to be set to and remain null has been added to the roadmap for the Form component.
I will keep you updated on any further newsβ¦
Hi there @kt727 , and welcome to the forum!
So, for null values there are 2 things you can do:
1- Number inputs have a "Validation" rule where you allow nulls
2- For strings and dates, you can transform the object to update in your query applying something like what is explained here
Hope this helps keeping null values persistent!
Hey @haj , it's not the only way, but conceptually things haven't changed. You still need to ensure that you are either sending NULL back to the DB or not sending the key for that empty date value at all.
If you are using a form and don't want to explicitly set the values for each individual column like in the previous post, you can use a pretty simple JS query to make the adjustments.
[Screenshot 2023-10-05 at 9.05.48 AM]
[Screenshot 2023-10-05 at 9.06.00 AM]
Here, I'm deleting that key fβ¦
1 Like
Tess
May 8, 2025, 1:02am
3
Thanks, @MiguelOrtiz !
I don't have an eta, but I'll reach out here if we ship a fix/feature for this