> ## 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.

# Legacy expression aliases

> Compatibility names that remain callable in shared builder contexts, with the preferred modern spelling and migration examples.

## When to use these helpers

Use the preferred helper for new work. These aliases are recorded so an existing configuration can be understood and migrated deliberately. Most are not part of the document-template runtime.

## Calling style

Call a helper as `toLowercase($.service_name)`. 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

### `endWith`

Legacy alias for endsWith. Prefer endsWith(value, suffix).

**Signature:** `endWith(value, suffix)`

**Example:**

```txt theme={null}
endWith($.email, ".gov.sy") // true
```

**Availability:** Shared builder contexts only; not a portable document-template contract.

**Note:** It can also be written as a transform when the first value is the input: `value | endWith(...)`.

### `flat`

Legacy alias for flatten. Prefer flatten(list).

**Signature:** `flat(list)`

**Example:**

```txt theme={null}
flat([["identity"], ["address"]]) // ["identity", "address"]
```

**Availability:** Shared builder contexts only; not a portable document-template contract.

**Note:** It can also be written as a transform when the first value is the input: `value | flat(...)`.

### `formatDate`

Legacy alias for dateFormat. Prefer dateFormat(date, format).

**Signature:** `formatDate(date, format)`

**Example:**

```txt theme={null}
formatDate($.received_at, "YYYY-MM-DD")
```

**Availability:** Shared builder contexts only; not a portable document-template contract.

**Note:** It can also be written as a transform when the first value is the input: `value | formatDate(...)`.

### `get`

Legacy alias for getByPath. Prefer getByPath(value, path).

**Signature:** `get(value, path)`

**Example:**

```txt theme={null}
get($.applicant, "address.district")
```

**Availability:** Shared builder contexts only; not a portable document-template contract.

**Note:** It can also be written as a transform when the first value is the input: `value | get(...)`.

### `replaceFirst`

Legacy alias for replace. It replaces the first matching occurrence only.

**Signature:** `replaceFirst(value, search, replacement)`

**Example:**

```txt theme={null}
replaceFirst("REQ-REQ-10", "REQ-", "") // "REQ-10"
```

**Availability:** Shared builder contexts only; not a portable document-template contract.

**Note:** It can also be written as a transform when the first value is the input: `value | replaceFirst(...)`.

### `sort`

Compatibility sorter that copies and orders values numerically when possible. It replaces the module sort registration; use sortAsc, sortDesc, or sortBy for new configurations.

**Signature:** `sort(list, direction = "asc")`

**Example:**

```txt theme={null}
sort([12, 3, 8], "desc") // [12, 8, 3]
```

**Availability:** Shared builder contexts only; not a portable document-template contract.

**Note:** It can also be written as a transform when the first value is the input: `value | sort(...)`.

### `sortByField`

Compatibility alias for sortBy. Prefer sortBy(list, field, direction).

**Signature:** `sortByField(list, field, direction = "asc")`

**Example:**

```txt theme={null}
sortByField($inverseRelations.inspections.request_id, "scheduled_at", "asc")
```

**Availability:** Shared builder contexts only; not a portable document-template contract.

**Note:** It can also be written as a transform when the first value is the input: `value | sortByField(...)`.

### `startWith`

Legacy alias for startsWith. Prefer startsWith(value, prefix).

**Signature:** `startWith(value, prefix)`

**Example:**

```txt theme={null}
startWith($.reference, "CSR-") // true
```

**Availability:** Shared builder contexts only; not a portable document-template contract.

**Note:** It can also be written as a transform when the first value is the input: `value | startWith(...)`.

### `toLowercase`

Legacy alias for lower. Prefer lower(value) in new configurations.

**Signature:** `toLowercase(value)`

**Example:**

```txt theme={null}
toLowercase($.service_name) // "citizen service"
```

**Availability:** Shared builder contexts only; not a portable document-template contract.

**Note:** It can also be written as a transform when the first value is the input: `value | toLowercase(...)`.

### `toUppercase`

Legacy alias for upper. Prefer upper(value) in new configurations.

**Signature:** `toUppercase(value)`

**Example:**

```txt theme={null}
toUppercase($.district_code) // "DAMASCUS"
```

**Availability:** Shared builder contexts only; not a portable document-template contract.

**Note:** It can also be written as a transform when the first value is the input: `value | toUppercase(...)`.

## 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.

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