---
schema_version: "1"
id: 803bf81605bdbf624525829e5d17f0170f00e3d575048b1606c18268b9c1cf23
title: Tree (dw::util::Tree)
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.12/dw-tree.md
canonical_url: https://docs.mulesoft.com/dataweave/2.12/dw-tree
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 22dfc24a27f360b3649d8d4997db92b70e9f26f5b87b0c70c5923466ea82f6fd
description: MuleSoft Documentation Site
release: "2.12"
latest: false
---
---
product: DataWeave
version: 2.12
---

# Tree (dw::util::Tree)

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

This utility module provides functions for handling values as tree-data structures.

To use this module, you must import it to your DataWeave code, for example, by adding the line
`import * from dw::util::Tree` to the header of your DataWeave script.

_Introduced in DataWeave version 2.2.2._

## Functions

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.12/dw-tree-functions-asexpressionstring">asExpressionString</a></p></td><td><p>Transforms a <code>Path</code> value into a string representation of the path.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.12/dw-tree-functions-filterarrayleafs">filterArrayLeafs</a></p></td><td><p>Applies a filtering expression to leaf or <code>Path</code> values of an array.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.12/dw-tree-functions-filterobjectleafs">filterObjectLeafs</a></p></td><td><p>Applies a filtering expression to leaf or <code>Path</code> values of keys in an object.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.12/dw-tree-functions-filtertree">filterTree</a></p></td><td><p>Filters the value or path of nodes in an input based on a specified <code>criteria</code>.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.12/dw-tree-functions-isarraytype">isArrayType</a></p></td><td><p>Returns <code>true</code> if the provided <code>Path</code> value is an <code>ARRAY_TYPE</code> expression.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.12/dw-tree-functions-isattributetype">isAttributeType</a></p></td><td><p>Returns <code>true</code> if the provided <code>Path</code> value is an <code>ATTRIBUTE_TYPE</code> expression.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.12/dw-tree-functions-isobjecttype">isObjectType</a></p></td><td><p>Returns <code>true</code> if the provided <code>Path</code> value is an <code>OBJECT_TYPE</code> expression.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.12/dw-tree-functions-mapleafvalues">mapLeafValues</a></p></td><td><p>Maps the terminal (leaf) nodes in the tree.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.12/dw-tree-functions-nodeexists">nodeExists</a></p></td><td><p>Returns <code>true</code> if any node in a given tree validates against the specified criteria.</p></td></tr></tbody></table>

## Variables

- [Tree Variables](https://docs.mulesoft.com/dataweave/2.12/dw-tree-variables)

## Types

- [Tree Types](https://docs.mulesoft.com/dataweave/2.12/dw-tree-types)
