Skip to main content

When to use these helpers

Validation helpers return true when the value is valid and a localized validation message when it is not. In field validation contexts, the current value is supplied automatically when the helper’s value argument is omitted.

Calling style

Call a helper as v.required($.field). Not every helper is available everywhere: validation, form, and document-template helpers have distinct context contracts. Editor suggestions are not proof that a helper is supported at runtime.

Complete function reference

v

Returns true for a passing condition or a localized error value for a failed condition. Signature: v(condition, error) Example:
Note: Use this as a function call, not as a transform.

v.atLeastXYearsOld

Checks an age threshold from a date. Signature: v.atLeastXYearsOld(value, years) Example:
Note: Use this as a function call, not as a transform.

v.contains

Checks that text contains a required fragment. Signature: v.contains(value, fragment) Example:
Note: Use this as a function call, not as a transform.

v.datePattern

Checks that a value is a valid date. Signature: v.datePattern(value) Example:
Note: Use this as a function call, not as a transform.

v.endsWith

Checks that text ends with a required suffix. Signature: v.endsWith(value, suffix) Example:
Note: Use this as a function call, not as a transform.

v.equal

Checks strict equality with an expected value. Signature: v.equal(value, expected) Example:
Note: Use this as a function call, not as a transform.

v.greaterThan

Checks that a numeric value is greater than a limit. Signature: v.greaterThan(value, limit) Example:
Note: Use this as a function call, not as a transform.

v.greaterThanOrEqual

Checks that a numeric value meets a minimum. Signature: v.greaterThanOrEqual(value, minimum) Example:
Note: Use this as a function call, not as a transform.

v.lessOrEqual

Checks that a numeric value does not exceed a limit. Signature: v.lessOrEqual(value, maximum) Example:
Note: Use this as a function call, not as a transform.

v.lessThan

Checks that a numeric value is less than a limit. Signature: v.lessThan(value, limit) Example:
Note: Use this as a function call, not as a transform.

v.matchRegex

Checks that text matches a regular expression. Signature: v.matchRegex(value, pattern) Example:
Note: Use this as a function call, not as a transform.

v.maxLength

Checks the maximum length of text or a list. Signature: v.maxLength(value, maximum) Example:
Note: Use this as a function call, not as a transform.

v.minLength

Checks the minimum length of text or a list. Signature: v.minLength(value, minimum) Example:
Note: Use this as a function call, not as a transform.

v.notOneOf

Checks that a value is not one of the supplied options. Signature: v.notOneOf(value, options) Example:
Note: Use this as a function call, not as a transform.

v.oneOf

Checks that a value is one of the supplied options. Signature: v.oneOf(value, options) Example:
Note: Use this as a function call, not as a transform.

v.onlyAlphabets

Allows letters and spaces only. Signature: v.onlyAlphabets(value) Example:
Note: Use this as a function call, not as a transform.

v.onlyAlphabetsOfLanguage

Allows letters for a chosen language and spaces only. Signature: v.onlyAlphabetsOfLanguage(value, language) Example:
Note: Use this as a function call, not as a transform.

v.onlyDigits

Allows ASCII digits only. Signature: v.onlyDigits(value) Example:
Note: Use this as a function call, not as a transform.

v.phoneNumber

Checks an international-style phone number. Signature: v.phoneNumber(value) Example:
Note: Use this as a function call, not as a transform.

v.required

Checks that a value is present and non-blank. Signature: v.required(value) Example:
Note: Use this as a function call, not as a transform.

v.startsWith

Checks that text starts with a required prefix. Signature: v.startsWith(value, prefix) Example:
Note: Use this as a function call, not as a transform.

v.validEmail

Validates an email address. Signature: v.validEmail(value) Example:
Note: Use this as a function call, not as a transform.

Before you publish

  • Start with a known value and confirm the expected result.
  • Handle null, empty text, and empty lists deliberately.
  • Do not place secrets, access tokens, or sensitive personal data in an expression.
  • Read expression contexts and availability before copying an expression between features.
Validation helpers in KayanOS