---
schema_version: "1"
id: ea802d1f30d46bb2ff73fabf4624da1c0d5b1da5d26401da333bd49931a307ca
title: mapLeafValues
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.3/dw-tree-functions-mapleafvalues.md
canonical_url: https://docs.mulesoft.com/dataweave/2.3/dw-tree-functions-mapleafvalues
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 823e7bfbc9f5fcb7076e0e5aec5ebee3bfc328757f7cdb99f761ebd24fb0edfc
description: MuleSoft Documentation Site
release: "2.3"
latest: false
---
---
product: DataWeave
version: 2.3
---

# mapLeafValues

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

## mapLeafValues(Any, (value: Any, path: Path) -> Any): Any

Maps the terminal (leaf) nodes in the tree.

Leafs nodes cannot have an object or an array as a value.

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>value</code></p></td><td><p>The value to map.</p></td></tr><tr><td><p><code>callback</code></p></td><td><p>The mapper function.</p></td></tr></tbody></table>

### Example

This example transforms all the string values to upper case.

#### Source

```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)
```

#### Output

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