To ensure data accuracy, security, and consistency in collections, NocoBase provides field validation functionality. This feature consists of two main parts: rule configuration and rule application.

NocoBase system fields integrate Joi rules, with support as follows:
Joi string types correspond to the following NocoBase field types: Single Line Text, Long Text, Phone, Email, URL, Password, and UUID.



Joi number types correspond to the following NocoBase field types: Integer, Number, and Percentage.
In addition to common rules, integer fields additionally support integer validation and unsafe integer validation.

In addition to common rules, number and percentage fields additionally support precision validation.

Joi date types correspond to the following NocoBase field types: Date (with timezone), Date (without timezone), Date only, and Unix timestamp.
Supported validation rules:
Association fields only support required validation. Note that required validation for association fields is currently not supported in sub-form or sub-table scenarios.

After configuring field rules, the corresponding validation rules will be triggered when adding or modifying data.

Validation rules also apply to sub-table and sub-form components:


Note that in sub-form or sub-table scenarios, required validation for association fields does not take effect.

Client-side and server-side field validation are applied in different scenarios, with significant differences in implementation and rule trigger timing, so they need to be managed separately.

