---
schema_version: "1"
id: ae56ff6b8387c10567655e998e5c04adec647d0b58f253af5c9970c75c2f066a
title: indexWhere
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.3/dw-arrays-functions-indexwhere.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.3/dw-arrays-functions-indexwhere
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 736c843ad5770c4dd4c879c2772f6a24dd71f97857882775bce82c90ae6b3d0b
description: MuleSoft Documentation Site
release: "2.3"
latest: false
---
# indexWhere

## [](#indexwhere1)indexWhere(Array<T>, (item: T) -> Boolean): Number

配列内で条件に一致する最初に出現する要素のインデックスを返します。

_DataWeave 2.2.0 で導入されました。Mule 4.2 以降でサポートされます。_​

### [](#パラメーター)パラメーター

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;">
<col style="width: 75%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">名前</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>array</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">要素の配列。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>condition</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">配列の要素の照合に使用される条件 (式)。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、入力配列からラムダ式の条件 (​`(item) → item startsWith "Jul"`​) に一致する値のインデックスを返します。

#### [](#ソース)ソース

```DataWeave
%dw 2.0
import * from dw::core::Arrays
output application/json
var users = ["Mariano", "Leandro", "Julian"]
---
users indexWhere (item) -> item startsWith "Jul"
```

#### [](#出力)出力

```json
2
```