---
schema_version: "1"
id: 97a79f8b98a72db0683e2e6edf61a612e4b2c18b00fdabc8d74425aa16a6ec47
title: filterObjectLeafs
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.7/dw-tree-functions-filterobjectleafs.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.7/dw-tree-functions-filterobjectleafs
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 991bda131322a7ec730a879e595cc76ffce6833c05ec276981b4a728570748a8
description: MuleSoft Documentation Site
release: "2.7"
latest: false
---
# filterObjectLeafs

## [](#filterobjectleafs1)filterObjectLeafs(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>

### [](#例)例

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

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

```DataWeave
%dw 2.0
import * from dw::util::Tree
var myArray = [{name @(mail: "me@me.com", test:123 ): "", id:"test"},
               {name: "Me", id:null}]
output application/json
---
{
 a: {
     name: "Mariano",
     lastName: null,
     age: 123,
     friends: myArray
    }  filterObjectLeafs ((value, path) ->
         !(value is Null or value is String)),
 b: { c : null, d : "hello" } filterObjectLeafs ((value, path) ->
         (value is Null and isObjectType(path)))
}
```

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

```Json
{
  "a": {
    "age": 123,
    "friends": [
      {

      },
      {

      }
    ]
  },
  "b": {
    "c": null
  }
}
```