# Tasks and subtasks in a Tree view

> A Tree view nests records under their parent: add subtasks from a row, indent and outdent with the keyboard, drag a row onto another, and let parents count and add up what is under them.

Source: https://artavolo.com/page/using-the-tree-view

A Tree view shows a table as an outline: each record sits under its parent, and a parent opens and closes to show what is under it. A project opens into its phases and each phase into its tasks; a person into their direct reports. Every row is a full record: its fields edit in place as in a grid.

## Make a tree

1. The table needs a link field to itself that names each record's parent, such as *Parent*. Add one with **+** in the field header: choose **Link to another record** and pick this same table (see [Link records](https://artavolo.com/page/link-to-another-record)).
2. Open the views menu, choose **Tree** under **Create**, and pick that field as the parent.

The tree opens unfolded. The first time it is kept, the parent field gets a field going back, **Subtasks**, which lists the records under each one. A base owner can rename it.

## Add subtasks

- Point at a row and press the **+** at the end of its name, or right-click the row and choose **Add subtask**. The new record goes last under that row, ready for its name.
- Type the name and press **Enter**: the next subtask starts right under it, beside it. Keep typing and pressing Enter to write a list; press **Escape** to stop.
- **Insert record above** and **Insert record below** add a record beside the row, under the same parent.

## Move records in the tree

- **Alt+Shift+Right** puts the record under the one above it at its level. **Alt+Shift+Left** moves it up a level, beside its parent.
- Drag a row by its number onto the middle of another row to put it under that row. Drop it between two rows to put it beside them, and below the last row to move it to the top level.
- You can also change the **Parent** cell, or set it in the record.

A record never goes under itself or one of its own subtasks: such a move is refused with a short notice. Each move is one change of the parent field, so **Ctrl+Z** takes it back.

## Count and add up what is under a record

Because **Subtasks** is a link field, counts and rollups work over it like over any link:

- A **Count** field of Subtasks: how many subtasks a record has.
- A **Rollup** of Subtasks with `SUM(values)` of an hours or amount field: the total of the subtasks.
- A rollup with `AVERAGE(values)` of a percent field: how far along the subtasks are.

Counts and rollups read the records directly under a record. In a deeper tree, each level adds up the level under it.

## Filter, sort and count

- A filter or a search keeps each matching record under its parents. Parents that do not match themselves stay in the tree, greyed, so you see where a match belongs; they are not counted.
- A sort orders the records within each level and keeps every subtask under its parent.
- The record count in the view bar and the totals in the footer include folded records, and never the greyed parents.

## Good to know

- A record with two parents in the parent field is shown at the top level.
- A tree needs every record of the table at once. A table that is read a part at a time (more than 10,000 records) has no Tree view; an existing one shows its records as a list.
- The Work breakdown, Org chart and headcount, and Team budget templates start with a tree, Subtasks and their totals.

## Related

- [Create, switch and lock views](https://artavolo.com/page/view-settings)
- [Link records between tables](https://artavolo.com/page/link-to-another-record)
- [Plan a project on a Gantt chart](https://artavolo.com/page/using-the-gantt-view)
