# getDataPath

Builds a tree from a path array from root to the current node. Takes precedence over ID-based tree settings.

Canonical: https://grid.syidax.com/docs/options/getDataPath/

<a id="meaning"></a>

## What does this API do?

Builds a tree from a path array from root to the current node. Takes precedence over ID-based tree settings.

API for Pro features: Tree data

<a id="contract"></a>

## Exact input and result types

```typescript
getDataPath: (row: Record<string, unknown>) => readonly string[]
```

| Item | Value |
| --- | --- |
| JavaScript name | getDataPath |
| HTML attribute | get-data-path |
| Default | undefined |
| Input type | (row: Record<string, unknown>) => readonly string[] |

<a id="usage"></a>

## Usage flow

Set this on a property of the Grid element. Pass arrays, objects, and callbacks through JavaScript, and use new arrays or objects when applying changes.

<a id="recipes"></a>

## Feature explanations and examples

- [Tree data](https://grid.syidax.com/docs/features/tree-data.md) — Trees display parent-child data, such as folders or organizations, with indentation and expansion controls. Unlike grouping equal values, the parent relationship already exists in the data.
