--- title: "level of tree()" slug: "basic-tree-level" updated: 2025-09-17T20:18:44Z published: 2025-09-22T09:16:13Z canonical: "docs.lobstersoftware.com/basic-tree-level" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # level of tree() This function returns the level of the node or field in the target structure. The level of the root node is defined as "1". A subnode of the root node has level "2" (level of parent node + 1). This function has no parameters. ## Examples The following target structure is given. ![images/download/attachments/201686741/291-version-1-modificationdate-1750239264829-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/291-version-1-modificationdate-1750239264829-api-v2.png) All fields and nodes contain the function described here. | Node/Field | Result | | --- | --- | | RootLevelNode | 1 | | RootLevelField | 2 | | SubLevelNode | 2 | | SubLevelField | 3 | | SubSubLevelNode | 3 | | SubSubLevelField | 4 |