Value Constraints: Choices, Units, Ranges and Patterns

Intermediate

Define allowed choices with colours, units and ranges for numbers, and patterns for text, so values stay consistent.

Value constraints say what a good value looks like. Metapad then shows values more clearly and warns you when one is off.

Open the constraints

Select a Node Type or Relationship Type, go to Property Definitions, and click the ⚙ button at the end of a property's row (tooltip: Value constraints). The button turns cyan once a property has constraints. What you can set depends on the data type:

Data typeConstraint
OptionChoices, each with a Value, a display Label and a Color
NumberUnit, Min, Max
StringPattern (regular expression)

Other data types and computed (f(x)) properties have no constraints.

Choices with labels and colours

Click Add choice for each allowed value. If the property already has a comma-separated list in its default value, Take over the list turns it into choices in one click. The choices then show as coloured chips in the Properties panel and in grids.

Units and ranges

Give cost the unit EUR or duration the unit days, and the unit appears next to the number. Set Min and/or Max to mark values outside a sensible range.

Patterns

A pattern checks text against a regular expression, for example ^[A-Z]{3}-\d+$ for codes like CRM-12.

Warnings, not blocks

A value that breaks a constraint is kept, with a warning next to it such as Not one of the choices, Below the minimum of 0 or Does not match the pattern …. Nothing you type is lost, and you can clean up imported data at your own pace.

The AI assistant and AI tools connected over MCP see the constraints too, and use them when they fill in values.

This content was written collaboratively with AI.