---
url: /set-instructions/set-formatting.md
description: Reference for Set Formatting in MODLR.
---

# Set Formatting

Set Formatting instructions control the *shape* of a set: which relatives of an already-selected element get pulled in, how deeply they're indented, whether subtotals sit above or below their detail, and whether users can expand and collapse elements once the Workview is open.

| Instruction | What it does |
| --- | --- |
| [Expand](/set-instructions/expand) | Adds the immediate children of every element in the working list, indented one level beneath their parent. |
| [Expand All](/set-instructions/expand-all) | Adds every descendant of every element in the working list, down to the leaves. |
| [Expand Next Instruction](/set-instructions/expand-next-instruction) | A modifier: expands whatever the *next* instruction adds, without expanding the rest of the working list. |
| [Collapse Next Instruction](/set-instructions/collapse-next-instruction) | The mirror of Expand Next Instruction - collapses whatever the next instruction targets. |
| [Indent](/set-instructions/indent) | Adds one level of indentation to every element currently in the working list. |
| [Reset Indents](/set-instructions/reset-indents) | Removes all indentation from the working list - typically used after adding a parent element that inherited indentation it shouldn't have. |
| [Reverse (Subtotals At The Bottom)](/set-instructions/reverse-subtotals-at-the-bottom) | Flips expansion order so parents appear *after* their children instead of before. |
| [Enable Drill Down](/set-instructions/enable-drill-down) | Lets end users expand and collapse elements directly in the Workview. Web Workviews only - skipped elsewhere. |
| [Set Default Using The Next Instruction](/set-instructions/set-default-using-the-next-instruction) | Marks the element added by the next instruction as the default selection, e.g. for a title selectable. |
| [Add Blank Space](/set-instructions/add-blank-space) | Inserts a purely visual gap into the set - no element behind it. |

## Expansion always targets the working list

`Expand` and `Expand All` operate on whatever is currently in the working list at that point in the instruction stack - not on the set's final contents. Add a parent, then expand it, and only that parent's descendants come in. If you need one specific element expanded without expanding everything already selected, reach for `Expand Next Instruction` instead of restructuring the whole set.

## Reverse only affects what comes after it

`Reverse (Subtotals At The Bottom)` changes how *subsequent* expansions behave - it doesn't retroactively reorder an expansion that already happened. It has to sit before the `Expand` or `Expand All` it's meant to affect:

```
1. Element: EBITDA
2. Reverse (Subtotals At The Bottom)
3. Expand All
```

Putting `Reverse` after `Expand All` in that sequence has no effect - the expansion already ran in default (parent-above-children) order.

See [Common Patterns](/set-instructions/common-patterns) for full worked sequences using these instructions together, including the standard accounting-style "subtotals at the bottom" layout.
