> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kayanos.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Validation helpers

> Every registered validation helper, with signatures and examples for field rules that return a localized message when validation fails.

## 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:**

```txt theme={null}
v($.requesterName != null, "Requester is required")
```

**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:**

```txt theme={null}
v.atLeastXYearsOld($.birthDate, 18)
```

**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:**

```txt theme={null}
v.contains($.reference, "REQ-")
```

**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:**

```txt theme={null}
v.datePattern($.appointmentDate)
```

**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:**

```txt theme={null}
v.endsWith($.email, ".gov.sy")
```

**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:**

```txt theme={null}
v.equal($.status, "approved")
```

**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:**

```txt theme={null}
v.greaterThan($.area, 0)
```

**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:**

```txt theme={null}
v.greaterThanOrEqual($.staffCount, 1)
```

**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:**

```txt theme={null}
v.lessOrEqual($.attachmentsCount, 10)
```

**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:**

```txt theme={null}
v.lessThan($.requestedDays, 31)
```

**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:**

```txt theme={null}
v.matchRegex($.reference, "^REQ-[0-9]+$")
```

**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:**

```txt theme={null}
v.maxLength("permit", 40)
```

**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:**

```txt theme={null}
v.minLength("permit", 3)
```

**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:**

```txt theme={null}
v.notOneOf($.status, ["archived", "deleted"])
```

**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:**

```txt theme={null}
v.oneOf($.priority, ["low", "normal", "high"])
```

**Note:** Use this as a function call, not as a transform.

### `v.onlyAlphabets`

Allows letters and spaces only.

**Signature:** `v.onlyAlphabets(value)`

**Example:**

```txt theme={null}
v.onlyAlphabets($.applicantName)
```

**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:**

```txt theme={null}
v.onlyAlphabetsOfLanguage($.arabicName, "ar")
```

**Note:** Use this as a function call, not as a transform.

### `v.onlyDigits`

Allows ASCII digits only.

**Signature:** `v.onlyDigits(value)`

**Example:**

```txt theme={null}
v.onlyDigits($.nationalNumber)
```

**Note:** Use this as a function call, not as a transform.

### `v.phoneNumber`

Checks an international-style phone number.

**Signature:** `v.phoneNumber(value)`

**Example:**

```txt theme={null}
v.phoneNumber($.mobile)
```

**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:**

```txt theme={null}
v.required($.requesterName)
```

**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:**

```txt theme={null}
v.startsWith($.reference, "REQ-")
```

**Note:** Use this as a function call, not as a transform.

### `v.validEmail`

Validates an email address.

**Signature:** `v.validEmail(value)`

**Example:**

```txt theme={null}
v.validEmail("citizen@example.org")
```

**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](/reference/expressions/contexts) before copying an expression between features.

![Validation helpers in KayanOS](https://kayanos.app/docs-images/en/reference/expressions-helpers-validations.png)
