> For the complete documentation index, see [llms.txt](https://docs.unitlab.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unitlab.ai/documentation/ontologies/validation-and-conditional-logic.md).

# Required fields and validation

Make properties required and limit the values annotators can enter, so labels are complete and consistent.

**Required** makes sure an answer is given. **Validation** makes sure the answer has the right form. Together they catch missing and mistyped values while the annotator is still on the item.

## Make a property required

1. Click the property card in the builder.
2. Turn on **Required** on the right. The card shows a **REQ** badge.
3. Choose **Publish draft**.

A required nested property is checked only while it is visible. In the [robot grasping example](https://docs.unitlab.ai/documentation/ontologies/nested-properties.md), *Grasp type* is required only for objects marked *Pickable*.

## Add a validation rule

1. Click a text property card, for example **Estimated weight (g)**.
2. Set **Data type** to **Number**.
3. Under **Validation**, choose **Range** and enter **Min** 0 and **Max** 5000.
4. Add **Help text** that says what is accepted, for example "Weight in grams, numbers only".

The panel shows a summary of the rule, such as *Range 0-5000*.

## Rules by property type

| Property                | Rules           | Example                              |
| ----------------------- | --------------- | ------------------------------------ |
| Text, String            | Length, Regex   | Notes up to 120 characters           |
| Text, Number            | Range, Regex    | Approach angle from 0 to 180         |
| Text, Date or Date time | Range           | Inspection date within 2026          |
| Text, URL or Email      | Regex           | Email ending in @example.com         |
| Multi-choice            | Selection count | Pick 1 to 2 blocked reasons          |
| Single-choice, Boolean  | None needed     | The options already limit the answer |

## What annotators see

When a value is missing or breaks a rule, the Workbench lists the problem and points to the object. The value is kept, and the item can still be saved. It appears under the **Invalid** filter on the project's **Data** page until someone fixes it.

## Tips

* Make a property required only if a missing answer makes the label useless.
* Add **Unknown** or **Not visible** options for cases annotators can't judge. A guess is worse.
* Test every rule with a value just inside and just outside the limit.

## Related

[Nested properties](https://docs.unitlab.ai/documentation/ontologies/nested-properties.md) · [Properties, relations, and Item Properties](https://docs.unitlab.ai/documentation/ontologies/properties-relations-and-item-properties.md) · [Project data QA](https://docs.unitlab.ai/documentation/projects/project-data-qa.md)
