Max Length Check FAQ
Answers to common questions about how the Max Length check measures a text field, how NULLs and arrays behave, and how anomalies are reported, grouped by topic.
Behavior
Does the check count characters or bytes?
Characters. Accented and non-Latin characters count as one each, even when the storage or a downstream system counts them as more than one byte.
Does whitespace count toward the length?
Yes. The check counts characters exactly as stored, including leading and trailing spaces. Trim the value upstream when the padding is not meaningful.
How are NULL values treated?
NULLs pass. A row with NULL in the evaluated field is not counted as a violation. An empty string, on the other hand, is a present value with length zero and is evaluated normally. If the field must be populated, pair the check with a Not Null check.
What happens on an array field?
With Array Element Context on, each element's own string length is measured and the row fails as soon as one element is too long. With it off, Length caps the number of elements in the array rather than the characters in any of them. NULL elements are skipped, and empty or NULL arrays pass. Either way the array modes run as a field-level check and report a Shape Anomaly, never per-row Record Anomalies.
Does the filter run before or after the measurement?
Before. The platform applies the filter first and then measures only the rows that pass the filter. Filtered-out rows cannot trigger an anomaly and are not counted in the totals.
Anomaly Reporting
What do the anomaly messages look like?
Record Anomaly: The field '<field_name>' has value '<row_value>' (length <measured>), which exceeds the maximum length of <length>
Shape Anomaly: For the field '<field_name>', X.XXX% of N records (K) exceed the maximum length of <length>
The Record message echoes the measured length of the offending value. When a filter is set, both messages end with [filter: <expression>].
Does Max Length produce Record Anomalies, Shape Anomalies, or both?
On a scalar String field at 100% coverage (the default), violating rows are reported as Record Anomalies, and below 100% coverage a failed coverage assertion produces one Shape Anomaly for the dataset. On an array field, in either mode, the rule always reports a Shape Anomaly. A scan can also roll up a large number of Record Anomalies into one Shape Anomaly.
Does Custom Anomaly Description work for Max Length?
On a scalar String field, yes. Max Length emits Record Anomalies there, so the anomaly_message_field payload field (and the Custom Anomaly Description toggle in the UI) replaces the Record Anomaly message with the value of the named column on the violating row. When that column is null, missing, or empty, the standard Record template is used instead. It has no effect on an array field, which reports a Shape Anomaly, and Shape Anomalies always use the fixed template.
Configuration
Can I lower the coverage on Max Length check?
Yes. Coverage at 1.0 (100%) means every row must pass. Lowering coverage to 0.995 allows up to 0.5% of rows to fail without raising an anomaly; once the failing fraction goes past that, the check reports a Shape Anomaly. Use lower coverage with care: a real regression that happens to fall just under the threshold will not raise an alert at all.
Can I change the length on an existing check?
Yes. In the UI, open the check, change Length, and click Update; see Edit a Check for the full steps. Through the API, a PUT to /api/quality-checks/{id} updates properties.value. The rule type, the target container, and the associated Check Template stay immutable; see the API page for the editable/immutable matrix.
What permission do I need to create or edit Max Length check?
The Drafter team permission on the datastore covers Draft work (creating a check as Draft or editing it while it stays Draft). Anything that puts the check into evaluation, such as creating or editing an Active check, archiving, or deleting, requires the Author team permission (or above). Viewing only requires Reporter. See Permissions for the full matrix.
Should I use a length check or Matches Pattern?
Use a length check when size is the rule. When the field has a known format, Matches Pattern expresses the real constraint and usually makes the length check redundant.