Skip to content
Get started

Validations

Validations are the rules Grunddata applies whenever a record is saved. They are the difference between a spreadsheet and governed business data.

Validations are expressed using JSON Schema, but you do not have to write JSON — the web app builds the schema from a form.

Level Attached to Use when
Attribute A single attribute The rule concerns one value on its own
Table The whole table The rule compares two attributes with each other

Open an attribute and add a validation. The available rules depend on the datatype.

Rule Meaning Example
Starts with Value must begin with a prefix Account numbers must start with 4
Ends with Value must end with a suffix Codes must end with -SE
Min length Minimum number of characters At least 3 characters
Regex pattern Value must match a regular expression ^[A-Z]{3}$ for a three-letter code
One of (list) Value must be one of an explicit list NOM, MTM, INT
Rule Meaning Example
Number comparison Greater than / less than a fixed value Limit must be > 0
Multiple of Value must be a multiple of a number Amounts in whole thousands
One of (list) Value must be one of an explicit list 1, 5, 10

Table level rules: comparing two attributes

Section titled “Table level rules: comparing two attributes”

Some rules cannot live on a single attribute — they are about the relationship between two. Open the table and use its validation editor to add a comparison.

Each comparison rule has a left attribute, an operator and a right attribute:

Operator Meaning
> is greater than
>= is greater than or equal to
< is less than
<= is less than or equal to
!= is not equal to

The two attributes must be of a compatible family:

Family Datatypes Allowed operators
Number integer, decimal all
Temporal date, datetime all
String string != only
Rule Reads as
valid_to > valid_from The end of a period must be after its start
soft_limit <= hard_limit A soft limit may not exceed the hard limit
primary_contact != backup_contact The two contacts must be different people

The validation editor has a Preview action. It runs the proposed rule against the records already in the table and reports:

  • How many records are valid.
  • How many would fail.
  • A sample of the failing records, with Code, Name and the specific failure messages.

A save is all-or-nothing per record. When a record fails:

  • The record is not written. No partial save, no truncated value.
  • An entry is added to the record audit with status error and a human-readable message.
  • In the web app, the message appears directly in the record form.
  • In Excel and Google Sheets, the failing rows are reported back after the upload so the user can correct them and try again.
  1. Start with attribute properties. Required, unique and max length cover a surprising amount, and they cost nothing.

  2. Replace free text with domain tables wherever a fixed set of values exists. This removes whole classes of error rather than catching them.

  3. Add attribute validations for format rules that a lookup cannot express — patterns, ranges, minimum lengths.

  4. Add table validations for cross-field business rules.

  5. Preview each rule against real data before saving it.