I have an established layout with a text field on it. I type the following into the field:
Done on 11 Sep.
and the type of the column turns into Date, which is definitely not desired.
This has been raised before (in September 2021) with @Federico.Stefanato suggesting that the form itself might have been getting edited. There was no further comment on that thread, but in my case, I can definitely confirm that the form is not in editing mode: I was typing directly into the field.
Oddly though, now that I’m trying to repeat it, it’s not happening. I might have to see if I can recreate an exact sequence of steps that cause it to occur.
Pinging @Shaina_Torgerson as this bug might have the potential for significant data loss if Ctrl+Z isn’t instantly hit to revert the data type change.We’ve since established that this only occurs with columns that have no values, so there’s no risk of significant data loss.
Okay, I’ve been able to successfully reproduce the problem and I’ve captured it in a screen recording. The screen recording contains data I don’t want to publicise. What is the best way to submit this recording privately?
This happens when the table has no rows, and Coda sees the first row as a date. It very helpfully tries to auto-set the column type for you (it happens in tables as well as forms). Coda is in my opinion overeager in two ways:
it auto-changes column type based on forms which should NOT happen
it parses a bunch of things as a date that are very much not a date (even weirder ones than what you see here). A side effect of this problem is it breaks alphabetical sorts (you have a bunch of texts in a column; some are dates according to coda, which stores them as a date number under the hood, which makes them alphabetized before all letters)
I think I can offer a small amendment to this description of the logic (as my table has several hundred rows and it’s still happening):
This conversion happens when the column has no values.
I’m using this column as a UI helper, so unless I’m actively editing a row, no row has a value in this column. That at least explains why I couldn’t immediately replicate the behaviour: I’d left a value in this column on another row. Once I cleared it and tried again, the data type conversion happened “reliably”.
I definitely don’t want the conversion logic on this column, because I’m not trying to enter just a date and have this field treated as a date. (It’s also a little odd that it defaults to the year 2001 instead of the current year.)