> For the complete documentation index, see [llms.txt](https://docs.videsk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.videsk.io/es-developers/webhooks/helpers/find.md).

# #find

A continuación, podrás encontrar la documentación de como utilizar este helper.

Este tipo de helper tiene como utilidad filtrar valores de un `Array`, basado en comparaciones utilizando helpers de comparación y obtener un valor único que coincida con las comparaciones realizadas.

{% hint style="info" %}
Este helper está diseñado para ser utilizado solamente con `Array.`
{% endhint %}

#### Datos de ejemplo

```json
{
    "orders": [
        "61b1fbc001e98ee2f8c1f18f",
        "61d389800464df1d4ea02c7b",
        "61d3895e3f52541cf9709398"
    ],
    "cart": [
        {
            "product": "61d38c4b63f59bb2af02cf4d",
            "stock": true,
            "quantity": 2
        },
        {
            "product": "61d38c7a80683ba3dfd05c63",
            "stock": false,
            "quantity": 1
        }
    ]
    
}
```

## Ejemplos de uso

{% hint style="info" %}
Te recomendamos utilizar `#find` en conjunto con otros helpers de comparación como [`#isEqual`](/es-developers/webhooks/helpers/isequal.md), [`#isNot`](/es-developers/webhooks/helpers/isnot.md), [`#includes`](/es-developers/webhooks/helpers/includes.md), etc.
{% endhint %}

{% code title="Simple array with single conditional" %}

```handlebars
{{#find orders}}
  {{#isEqual this}}61b1fbc001e98ee2f8c1f18f{{/isEqual}}
{{/find}}
// Output: "61b1fbc001e98ee2f8c1f18f"
```

{% endcode %}

{% code title="Object find with single conditionals" %}

```handlebars
{{#find cart}}
  {{#isEqual this.stock}}true{{/isEqual}}
{{/find}}
// Output: { id: "61d38c4b63f59bb2af02cf4d", status: true, ... }
```

{% endcode %}

{% code title="Object find with multiple conditionals" %}

```handlebars
{{#find cart}}
  {{#greater this.quantity}}1{{/greater}}
  {{#isEqual this.stock}}true{{/isEqual}}
{{/find}}
// Output: { id: "61d38c4b63f59bb2af02cf4d", ... }
```

{% endcode %}

{% hint style="info" %}
El resultado final siempre será el valor de uno de los elementos del `Array`.
{% endhint %}

{% hint style="info" %}
Para más información sobre el uso de <mark style="color:purple;">`@root`</mark> o <mark style="color:purple;">`this`</mark> [haz clic aquí](/es-developers/webhooks/sintaxis.md#contenido-de-un-helper).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.videsk.io/es-developers/webhooks/helpers/find.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
