---
schema_version: "1"
id: 13b80c7c0bc5d28d541f25a323a376f6a2ffc048e33de2e7ae84d2a39f6b180a
title: filterArrayLeafs
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.8/dw-tree-functions-filterarrayleafs.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.8/dw-tree-functions-filterarrayleafs
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 411968104a2bdfec760afe844d3577acd64589705ed73bf5f7b462a10a410dce
description: MuleSoft Documentation Site
release: "2.8"
latest: false
---
# filterArrayLeafs

## [](#filterarrayleafs1)filterArrayLeafs(value: Any, criteria: (value: Any, path: Path) -> Boolean): Any

絞り込み式を配列のリーフまたは ​`Path`​ 値に適用します。

配列のリーフ値は ​`SimpleType`​ 値または ​`Null`​ 値である必要があります。型の説明については、 [「Core 型」](https://docs.mulesoft.com/dataweave/latest/dw-core-types)​を参照してください。

_DataWeave バージョン 2.4.0 で導入されました。_

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

<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>value</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>Any</code>​ 型の入力値。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>criteria</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">入力 ​<code>value</code>​ のすべての配列の ​<code>SimpleType</code>​ または ​<code>Null</code>​ リーフ値に適用する Boolean (ブール) 式。結果が ​<code>true</code>​ の場合、配列ではリーフ値が保持されます。それ以外の場合、この関数により、リーフ値が出力から削除されます。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、さまざまな入力での ​`filterArrayLeafs`​ の動作を示します。

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

```DataWeave
%dw 2.0
import * from dw::util::Tree
var myArray = [1, {name: ["", true], test: 213}, "123", null]
output application/json
---
{
   a: myArray filterArrayLeafs ((value, path) ->
        !(value is Null or value is String)),
   b:  myArray filterArrayLeafs ((value, path) ->
        (value is Null or value == 1)),
   c: { a : [1,2] } filterArrayLeafs ((value, path) ->
        (value is Null or value == 1)),
   d: myArray filterArrayLeafs ((value, path) ->
        !isArrayType(path))
}
```

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

```Json
{
  "a": [
    1,
    {
      "name": [
        true
      ],
      "test": 213
    }
  ],
  "b": [
    1,
    {
      "name": [

      ],
      "test": 213
    },
    null
  ],
  "c": {
    "a": [
     1
    ]
  },
  "d": [
    {
      "name": [

      ],
      "test": 213
    }
  ]
}
```