How to Enforce Column Types in Coda (Prevent Invalid Entries)

I have defined some columns as “currency” but Coda seems to allow users to enter any values in these (even values that are not numbers, like “donated”). This breaks a myriad of calculations (like Sum()) since these values are not numbers.

The whole point of selecting column types is to enforce certain constraints on the data, isn’t it? Yet Coda seems to enforce no constraints. I cannot even find an option to “enforce column types” or the like in column settings, table settings, or document settings.

Can Coda be told to enforce column types?

1 Like

Another way to handle this would be to make it possible to “validate” data. For example, if I am looking for a number I could create a formula to return true if the value is a number and false if not.

1 Like

Yeah I think your validation approach is the correct one.

You can use the formula IsNumber() to determine whether something is a valid number.

So for example, you could have a checkbox column called “Valid?” with formula thisRow.AmountColumn.IsNumber() (would result in “True” aka “checked” if it’s a number, and “False” aka “unchecked” if not)

Or for things where you’re summing or manipulating the numbers, you could do AmountColumn.Filter(currentValue.IsNumber()) to get just the numbers and none of the other entries.

1 Like