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

# Comparison and conditional helpers

> Every registered comparison and conditional helper, with signatures and examples for rules, visibility, and calculated decisions.

## When to use these helpers

Prefer a small explicit condition over a long nested expression. Evaluate null and empty values deliberately before using a result to change a status, routing decision, or public output.

## Calling style

Call a helper as `between($.requested_amount, 1000, 10000)`. 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

### `andFn`

Combines two truthy checks.

**Signature:** `andFn(left, right)`

**Example:**

```txt theme={null}
andFn(true, true) // true
```

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

### `between`

Checks whether a numeric or comparable value is inside an inclusive range. This is the active between helper; the earlier text-extraction registration is overwritten.

**Signature:** `between(value, minimum, maximum)`

**Example:**

```txt theme={null}
between($.requested_amount, 1000, 10000)
```

**Availability:** General helper in shared builder and document-template runtimes; function and transform forms are available.

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

### `coalesce`

Returns the first non-null value.

**Signature:** `coalesce(first, fallback)`

**Example:**

```txt theme={null}
coalesce(null, "Unassigned") // "Unassigned"
```

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

### `defaultTo`

Returns the first argument that is not null or undefined; an empty string is retained.

**Signature:** `defaultTo(...values)`

**Example:**

```txt theme={null}
defaultTo(null, undefined, "Not provided") // "Not provided"
```

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

### `eq`

Compares two values with loose equality.

**Signature:** `eq(left, right)`

**Example:**

```txt theme={null}
eq("4", 4) // true
```

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

### `equalsAll`

Checks whether every variadic candidate equals a value.

**Signature:** `equalsAll(value, ...candidates)`

**Example:**

```txt theme={null}
equalsAll("open", "open", "open") // true
```

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

### `equalsAny`

Checks a value against any variadic candidate.

**Signature:** `equalsAny(value, ...candidates)`

**Example:**

```txt theme={null}
equalsAny("high", "low", "high") // true
```

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

### `gt`

Checks whether the first value is greater than the second.

**Signature:** `gt(left, right)`

**Example:**

```txt theme={null}
gt(8, 5) // true
```

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

### `gte`

Checks whether the first value is greater than or equal to the second.

**Signature:** `gte(left, right)`

**Example:**

```txt theme={null}
gte(8, 8) // true
```

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

### `hasProperty`

Checks whether an object has a property.

**Signature:** `hasProperty(value, property)`

**Example:**

```txt theme={null}
hasProperty({ owner: "A" }, "owner") // true
```

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

### `ifElse`

Returns one of two values based on a condition.

**Signature:** `ifElse(condition, whenTrue, whenFalse)`

**Example:**

```txt theme={null}
ifElse(true, "open", "closed") // "open"
```

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

### `inOp`

Checks whether a value exists in a string or list.

**Signature:** `inOp(value, collection)`

**Example:**

```txt theme={null}
inOp("approved", ["draft", "approved"]) // true
```

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

### `inRange`

Checks a value against one or more inclusive \[minimum, maximum] ranges.

**Signature:** `inRange(value, ...ranges)`

**Example:**

```txt theme={null}
inRange(25, [0, 100]) // true
```

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

### `instanceOf`

Checks a value against a constructor supplied by the evaluation context.

**Signature:** `instanceOf(value, constructor)`

**Example:**

```txt theme={null}
instanceOf($.issued_at, Date) // only where Date is explicitly supplied
```

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

### `isNotNull`

Checks whether a value is present.

**Signature:** `isNotNull(value)`

**Example:**

```txt theme={null}
isNotNull("assigned") // true
```

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

### `isNull`

Checks whether a value is null or undefined.

**Signature:** `isNull(value)`

**Example:**

```txt theme={null}
isNull(null) // true
```

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

### `isType`

Checks a value against a named JavaScript type.

**Signature:** `isType(value, type)`

**Example:**

```txt theme={null}
isType("open", "string") // true
```

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

### `like`

Matches text with a percent-wildcard pattern, case-insensitively.

**Signature:** `like(value, pattern)`

**Example:**

```txt theme={null}
like("Service request", "Service%") // true
```

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

### `lt`

Checks whether the first value is less than the second.

**Signature:** `lt(left, right)`

**Example:**

```txt theme={null}
lt(5, 8) // true
```

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

### `lte`

Checks whether the first value is less than or equal to the second.

**Signature:** `lte(left, right)`

**Example:**

```txt theme={null}
lte(5, 5) // true
```

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

### `ne`

Checks loose inequality.

**Signature:** `ne(left, right)`

**Example:**

```txt theme={null}
ne("4", 4) // false
```

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

### `not`

Negates a truthy or falsy value.

**Signature:** `not(value)`

**Example:**

```txt theme={null}
not(true) // false
```

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

### `notEqualsAny`

Checks whether a value differs from every variadic candidate.

**Signature:** `notEqualsAny(value, ...candidates)`

**Example:**

```txt theme={null}
notEqualsAny("closed", "draft", "open") // true
```

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

### `notIn`

Checks whether a value does not exist in a string or list.

**Signature:** `notIn(value, collection)`

**Example:**

```txt theme={null}
notIn("closed", ["draft", "approved"]) // true
```

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

### `notLike`

Checks that text does not match a case-insensitive percent-wildcard pattern.

**Signature:** `notLike(value, pattern)`

**Example:**

```txt theme={null}
notLike("Service request", "Permit%") // true
```

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

### `orFn`

Combines two truthy checks.

**Signature:** `orFn(left, right)`

**Example:**

```txt theme={null}
orFn(false, true) // true
```

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

### `regex`

Matches text with a regular-expression pattern.

**Signature:** `regex(value, pattern, flags)`

**Example:**

```txt theme={null}
regex("REQ-104", "^REQ-[0-9]+$") // true
```

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

### `safeGet`

Reads a nested property without throwing for a missing value.

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

**Example:**

```txt theme={null}
safeGet({ owner: { name: "A" } }, "owner.name") // "A"
```

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

### `strictEq`

Compares two values without type coercion.

**Signature:** `strictEq(left, right)`

**Example:**

```txt theme={null}
strictEq("4", 4) // false
```

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

### `strictNe`

Checks strict inequality without type coercion.

**Signature:** `strictNe(left, right)`

**Example:**

```txt theme={null}
strictNe("4", 4) // true
```

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

### `xorFn`

Returns true when exactly one input is truthy.

**Signature:** `xorFn(left, right)`

**Example:**

```txt theme={null}
xorFn(true, false) // true
```

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

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

![Comparison and conditional helpers in KayanOS](https://kayanos.app/docs-images/en/reference/expressions-helpers-operators.png)
