---
schema_version: "1"
id: 7e5318265a7db95b17a13342f21abc6c4d3df8ae8f077ea913aa72fc92e307a8
title: some
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.12/dw-arrays-functions-some.md
canonical_url: https://docs.mulesoft.com/dataweave/2.12/dw-arrays-functions-some
source_site: docs.mulesoft.com
content_type: documentation
content_hash: c8e5384f3aefad1377651e2f527fe168e468dfcfbc63b61f3198472565bf3510
description: MuleSoft Documentation Site
release: "2.12"
latest: false
---
---
product: DataWeave
version: 2.12
---

# some

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## some<T>(list: Array<T>, condition: (T) -> Boolean): Boolean

Returns `true` if at least one element in the array matches the specified condition.

The function stops iterating after the first element that matches the condition is found.

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>list</code></p></td><td><p>The input array.</p></td></tr><tr><td><p><code>condition</code></p></td><td><p>A condition (or expression) used to match elements in the array.</p></td></tr></tbody></table>

### Example

This example applies a variety of expressions to elements of several input arrays. The `$` in the
condition is the default parameter for the current element of the array that the condition
evaluates. Note that you can replace the default `$` parameter with a lambda expression that
contains a named parameter for the current array element.

#### Source

```DataWeave
%dw 2.0
import * from dw::core::Arrays
output application/json
---
{ "results" : [
    "ok" : [
      [1,2,3] some (($ mod 2) == 0),
      [1,2,3] some ((nextNum) -> (nextNum mod 2) == 0),
      [1,2,3] some (($ mod 2) == 1),
      [1,2,3,4,5,6,7,8] some (log('should stop at 2 ==', $) == 2),
      [1,2,3] some ($ == 1),
      [1,1,1] some ($ == 1),
      [1] some ($ == 1)
    ],
    "err" : [
      [1,2,3] some ($ == 100),
      [1] some ($ == 2)
    ]
  ]
}
```

#### Output

```JSON
{
   "results": [
     {
       "ok": [ true, true, true, true, true, true, true ]
     },
     {
       "err": [ false, false ]
     }
   ]
 }
```

## some(list: Null, condition: (Nothing) -> Any): Boolean

Helper function that enables `some` to work with a `null` value.

_Introduced in DataWeave version 2.3.0._
