Scope & Context
We are working with custom fields on People and Companies objects in Twenty CRM. This ticket is about adding regex pattern validation support when creating or editing custom fields in a workspace.
Currently, Twenty CRM allows users to create custom text fields for objects (e.g., a "License Plate" field on People), but there is no way to enforce a specific format or pattern on the input. This is already supported in other platforms like Chatwoot's custom attributes, which allow defining a regex pattern and a hint message.
Current behavior
When creating a custom field for an object (e.g., People or Companies), the user can set a name, type, and description — but there is no option to define a validation pattern or regex for the field value.
This means that a field like "License Plate" (expected format: 3 uppercase letters + 3 digits, e.g. ABC123) accepts any arbitrary string with no validation, leading to inconsistent data quality across contacts.
Expected behavior
When creating or editing a custom field of type Text, the user should be able to optionally define:
- A Regex pattern — a regular expression the field value must match (e.g.
^[A-Z]{3}[0-9]{3}$)
- A Pattern hint — a short message shown to the user explaining the expected format (e.g.
Format: 3 uppercase letters followed by 3 digits. Example: ABC123)
If a value is entered that does not match the defined pattern, the field should display an inline validation error and prevent saving until corrected.
The following screenshot shows how Chatwoot implements this same feature
in their custom attributes — this is the expected UX behavior:
Technical inputs
- Add optional
validationPattern (string) and validationHint (string) properties to the custom field schema
- On the field creation/edit form, add a collapsible "Validation" section with inputs for regex pattern and hint
- On the field input component, apply
RegExp(validationPattern).test(value) before allowing save
- Display
validationHint as helper text below the field input when a pattern is defined
- Store both properties in the field metadata alongside existing properties like
label and description
Scope & Context
We are working with custom fields on People and Companies objects in Twenty CRM. This ticket is about adding regex pattern validation support when creating or editing custom fields in a workspace.
Currently, Twenty CRM allows users to create custom text fields for objects (e.g., a "License Plate" field on People), but there is no way to enforce a specific format or pattern on the input. This is already supported in other platforms like Chatwoot's custom attributes, which allow defining a regex pattern and a hint message.
Current behavior
When creating a custom field for an object (e.g., People or Companies), the user can set a name, type, and description — but there is no option to define a validation pattern or regex for the field value.
This means that a field like "License Plate" (expected format: 3 uppercase letters + 3 digits, e.g.
ABC123) accepts any arbitrary string with no validation, leading to inconsistent data quality across contacts.Expected behavior
When creating or editing a custom field of type
Text, the user should be able to optionally define:^[A-Z]{3}[0-9]{3}$)Format: 3 uppercase letters followed by 3 digits. Example: ABC123)If a value is entered that does not match the defined pattern, the field should display an inline validation error and prevent saving until corrected.
The following screenshot shows how Chatwoot implements this same feature
in their custom attributes — this is the expected UX behavior:
Technical inputs
validationPattern(string) andvalidationHint(string) properties to the custom field schemaRegExp(validationPattern).test(value)before allowing savevalidationHintas helper text below the field input when a pattern is definedlabelanddescription