Skip to main content

Show Records as a Tree

Goal​

Turn a view into a tree: the table's records nested inside each other, with the selected one's form or card beside the chart. Categories inside categories, cost centres, a bill of materials, an organisational chart — anything where a record has a parent of its own kind.

Prerequisites​

  • A table whose records have a parent: it needs a Lookup field pointing back at that same table. If yours has not got one, add it first — see Add a field to an entity.
  • A view of that table to turn into a chart. See Create a view.

Steps​

1. Tell the table it is a hierarchy​

Open the table, go to Fields, and select the lookup that holds the parent. Press Use as parent field.

This is a fact about the table, not about one view: it is what makes Tree appear as a layout, and what a new chart takes as its starting point so you do not have to remember which of several lookups is the parent one. The field list marks it (Parent field) afterwards.

The button appears only on a lookup that points back at this same table. A lookup to a different table does not describe a nesting — a chart built on one shows a flat list of roots with nothing under any of them — so it is not offered.

2. Set the view's layout to Tree​

Open the view in the View Designer. In the strip under the title, set Layout to Tree.

The Tree button appears in the title bar. Press it, and the panel that opens is where you say what the chart draws.

3. Check the top level​

The first card is the Top level. Its table is this view's own and cannot be changed — a view presents its own table's records, so a chart of anything else would be a different view.

Linked by is the lookup the records nest by. It is already filled in from step 1; the list offers only lookups pointing back at this table.

4. Say what a row looks like​

Everything else on the card is optional, and everything left alone comes from the table itself:

SettingLeft alone it usesSet it when
Row textThe table's primary fieldThe chart should read by something other than the record's name
Second lineThe table's secondary textChoose None on a chart — the parent's name is usually the row directly above, so repeating it wastes the line
IconThe table's own iconTwo kinds of row need telling apart at a glance
Show the record's pictureOffThe rows are people or products, where a face or a photograph identifies faster than a glyph
When selected, showIts formA card, for records people read rather than edit — or Nothing for a level that is only structure

5. Hang another table underneath (optional)​

Press Add a level. Choose its table, which level it hangs under, and the lookup on its own table that points at that parent.

That is how the seeded organisation chart shows the people of each unit under it: a Units level nesting by Parent Unit, and a People level under it linked by the person's Organisational Unit. The same mechanism models province → city → branch as three tables, or products under categories.

Only lookups pointing at the parent level's table are offered, for the same reason as in step 3.

Drag a level to change the order the parts of a node's children are drawn in — sub-units before people, or the other way round. The top level stays first.

6. Choose how the chart opens​

Two settings at the top of the panel:

  • Open the first level on load — on by default, which is what a navigation chart is for. Turn it off when the first level is already a long list.
  • Let readers focus the chart on one node — on by default. It gives readers a control to open the chart on one branch, with a trail back out.

7. Apply, then Save​

Apply commits the panel; Save stores the view. Cancel leaves the saved chart untouched — a half-built one would not render, so it cannot be left behind by accident.

Open the view in an app and you have a chart: click a record to see it beside the tree, double-click to open its page, and search the box at the top to find one without scrolling.

Turning it back into a list​

Set Layout back to List and Save. The chart's settings are removed rather than hidden — a view that said it was a list while carrying a chart nobody could see would put the chart back on the next save.

What to check when a chart looks wrong​

  • Everything is at the top level, nothing nests — the Linked by field is not the one that actually holds the parent, or the records have not got parents set.
  • A level never opens — its Linked by field points at the wrong table, or nobody has any records of that kind yet.
  • A level shows nothing when selected — its When selected, show is Nothing, or it names a form or view that does not exist on that table.
  • Save is refused — a level is missing its table or its link. Every level needs both.