---
schema_version: "1"
id: 90fa2b6e52234a4236204ebc77ac0c23af2c6128263eea9c681540a651b0013a
title: mapLeafValues
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.8/dw-tree-functions-mapleafvalues.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.8/dw-tree-functions-mapleafvalues
source_site: docs.mulesoft.com
content_type: documentation
content_hash: e68d6f5e97817e2bfd0c68519f26132ec41319c8c43b925377dfa95d239e03c4
description: MuleSoft Documentation Site
release: "2.8"
latest: false
---
# mapLeafValues

## [](#mapleafvalues1)mapLeafValues(value: Any, callback: (value: Any, path: Path) -> Any): Any

ツリー内のターミナル (リーフ) ノードをマップします。

リーフノードはオブジェクトまたは配列を値として持つことはできません。

_DataWeave バージョン 2.2.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>value</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>callback</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">マッパー関数。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、すべての文字列値を大文字に変換します。

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

```DataWeave
%dw 2.0
import * from dw::util::Tree
output application/json
---
 {
     user: [{
         name: "mariano",
         lastName: "achaval"
     }],
     group: "data-weave"
 } mapLeafValues (value, path) -> upper(value)
```

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

```Json
{
   "user": [
     {
       "name": "MARIANO",
       "lastName": "ACHAVAL"
     }
   ],
   "group": "DATA-WEAVE"
 }
```

### [](#例-2)例

次の例では、オブジェクト、配列、または属性の新しい値を返します。

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

```DataWeave
%dw 2.0
output application/json
import * from dw::util::Tree
---
{
    name: "Mariano",
    test: [1,2,3]
} mapLeafValues ((value, path) -> if(isObjectType(path))
                                        "***"
                                  else if(isArrayType(path))
                                        "In an array"
                                  else "Is an attribute")
```

#### [](#出力-2)出力

```Json
{
  "name": "***",
  "test": [
    "In an array",
    "In an array",
    "In an array"
  ]
}
```