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

# some

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

## some(Array<T>, (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(Null, (Nothing) -> Boolean): Boolean

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

_Introduced in DataWeave 2.3.0. Supported by Mule 4.3 and later._
