Programmatic constraints on Data Tables

It would be super useful to be able to put programmatic constraints on columns in tables. Such as ensuring a Number column that is meant to represent cost_per_unit_in_usd, is always a positive number.

Even if it’s not full programmatic support, some real simple canned constraints like IS_POSITIVE dropdown would be infinitely better than what currently exists.

And no, I don’t want to litter my code with checks, that’s the whole point of this request, so don’t suggest it please.

1 Like

It might be worth checking out the validator dependency that abstracts away some of this code.

1 Like

Is there a way to implement this by myself? Some sort of plugin that I can add on top of the data tables service?

The ORM library might give you a running start on an abstraction library sitting on top of data tables, where you can put those sorts of checks: Anvil ORM Library

1 Like