# find

Finds the first item in an array where a property matches a given value. Returns `null` if no match is found.

```liquid
{% assign product = products | find: "sku", "ABC123" %}
{% log product.title %}
```

#### Syntax

```liquid
{{ array | find: property, value }}
```

| Parameter  | Description                                                                  |
| ---------- | ---------------------------------------------------------------------------- |
| `array`    | Array of objects to search                                                   |
| `property` | Property name to match against (supports nested properties via dot notation) |
| `value`    | Value to compare against                                                     |

#### Return Value

Returns the first matching item, or `null` if no item matches.

#### Examples

**Find a product by SKU:**

```liquid
{% assign product = products | find: "sku", "T-SHIRT-RED-M" %}
{% if product %}
  {% log "Found: " | append: product.title %}
{% else %}
  {% log "Product not found" %}
{% endif %}
```

**Find an order by name:**

```liquid
{% assign order = orders | find: "name", "#1042" %}
{% log order.total_price %}
```

**Find by nested property:**

```liquid
{% assign edge = result.products.edges | find: "node.handle", "classic-tee" %}
{% log edge.node.title %}
```

**Find a customer by email:**

```liquid
{% assign customer = customers | find: "email", target_email %}
{% if customer %}
  {% log "Customer found: " | append: customer.first_name %}
{% endif %}
```

#### Notes

* Returns the **first** matching item — if multiple items match, only the first is returned
* Uses loose equality (`==`) for comparison
* Supports dot notation for nested properties: `"node.title"`, `"address.city"`
* For more complex matching conditions, use `find_exp`
* For building a reusable lookup by property, consider `index_by` instead


---

# 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://docs.datajet-app.com/liquid/filters/find.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.
