# FolderTreeNode

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Reference](https://developer.m-files.com/APIs/gRPC-API/Reference/index.md) > [Messages](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FolderTreeNode/

A folder to create. The tree is submitted as a flat list; a node refers to its parent by list index.

- **Full name:** `MFiles.FolderTreeNode`
- **Proto file:** [`mfiles/structs.proto`](https://developer.m-files.com/APIs/gRPC-API/downloads/proto/mfiles/structs.proto)

<a id="fields"></a>

## Fields

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="f-name"></a>`name` | `string` | 1 | The folder name. |
| <a id="f-parent_index"></a>`parent_index` | `int32` | 2 | The index of the parent node in the list, or -1 for a top-level folder. Must be smaller than the node's own index (parents come first). |

<a id="used-by-methods"></a>

## Used by methods

- [IRPCValueLists.CreateFolderTree](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCValueLists/CreateFolderTree/index.md): Creates a tree of traditional folders under one anchor in one transaction: either every folder is created or the call fails and nothing is saved.

<a id="used-in-fields"></a>

## Used in fields

- [`CreateFolderTreeRequest.nodes`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCValueLists/CreateFolderTree/index.md#request): The folders to create under the anchor, parents before children.
