# Value Checking

Functions for handling null/undefined values and checking if values exist.

***

## COALESCE

Returns the first defined (non-undefined) argument. Useful for fallback values.

**Syntax:** `COALESCE(value1, value2, value3, ...)`

**Example:**

```
COALESCE({item's Optional}, {item's Default}, "N/A")
```

**Result:** First non-undefined value among the arguments.

**Example:**

```
COALESCE(undefined, 0)
```

**Result:** `0`

***

## HAS\_VALUE / VALUE\_EXISTS

Returns `"True"` or `"False"` based on whether the input has a meaningful value.

**Syntax:** `HAS_VALUE(input)` or `VALUE_EXISTS(input)`

**Behavior:**

| Input                | Result    |
| -------------------- | --------- |
| Non-empty string     | `"True"`  |
| Empty string         | `"False"` |
| Number (including 0) | `"True"`  |
| NaN                  | `"False"` |
| Non-empty array      | `"True"`  |
| Empty array          | `"False"` |
| Object with keys     | `"True"`  |
| null/undefined       | `"False"` |

**Example:**

```
HAS_VALUE({item's Status})
```

**Result:** `"True"` if Status has a value; `"False"` if empty.

**Example:**

```
IF(HAS_VALUE({item's Notes}), {item's Notes}, "No notes")
```

**Result:** Notes value if present; otherwise `"No notes"`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://formulapro.shadebridge.com/formula-pro/formula-pro-custom-functions/value-checking.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
