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

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.firebolt.io/feedback

```json
{
  "path": "/reference-sql/functions-reference/lambda/array-first",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

> Reference material for ARRAY_FIRST function

# ARRAY_FIRST

Returns the first element in the given array for which the given function returns `true`. The `<function>` parameter must be included.

## Syntax

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
ARRAY_FIRST(<function>, <array>)
```

## Parameters

| Parameter    | Description                                                                                                                   | Supported input types                 |
| :----------- | :---------------------------------------------------------------------------------------------------------------------------- | :------------------------------------ |
| `<function>` | A [Lambda function](/guides/sql-dialect/arrays#manipulating-arrays-with-lambda-functions) used to check elements in the array | A Lambda function returning `BOOLEAN` |
| `<array>`    | The array evaluated by the function                                                                                           | Any array                             |

## Return Type

The element type of `<array>`

## Examples

The following example returns the first value in the `levels` array greater than 2:

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT
	ARRAY_FIRST(x -> x > 2, [ 1, 2, 4, 9 ]) AS levels;
```

**Returns**: `4`
