Tags, Properties and Column View
An outline answers one question well: where does this entry belong? Real information rarely fits a single hierarchy, though. A task in the “Website relaunch” project may also be something you can only do at the office, something that blocks a customer, and something estimated at 3 hours. Org gives you two kinds of metadata for these cross-cutting facts. Tags are short labels attached to a headline. Properties are key-value pairs stored in a drawer under the headline.
Both kinds of metadata follow the outline: a child can inherit what its parent declares. Both can be queried with the same compact match language, which drives sparse trees, agenda views and dynamic blocks. Properties can also be laid out as a table with column view, which turns an outline into a small database that you can edit in place. This chapter covers each of these in turn.
Tags
The essential idea
A tag is a word between colons at the end of a headline. A headline can have several tags, written one after another with single colons between them:
* Website relaunch :project:
** TODO Design the landing page :frontend:@home:
** TODO Migrate the user table :backend:crypt:
** DONE Choose a hosting provider :@office:
Tags may contain letters, digits, _, @, # and %. A common convention, used in the manual’s own examples, is to start context tags (places or tools you need) with @, so that @office and @home stand apart from topical tags such as backend.
Why tags rather than more headlines? Because a headline can sit in only one place in the tree, while it can carry any number of tags. Tags let you slice the same outline in several directions: by project through the tree, by context through @ tags, by area through topical tags.
Inheritance
Tags follow the tree. A headline has its own tags plus every tag of its ancestors. In the example above, “Migrate the user table” has its own tags backend and crypt and inherits project from its parent.
You can also declare tags for an entire file with the FILETAGS keyword. These tags behave as though they belonged to an invisible level 0 headline that contains the whole file:
#+FILETAGS: :acme:
Here is the complete file used for the examples in this section:
#+FILETAGS: :acme:
#+TAGS: [ dev : backend frontend ]
#+TAGS: { @office(o) @home(h) } laptop(l)
* Website relaunch :project:
** TODO Design the landing page :frontend:@home:
** TODO Migrate the user table :backend:crypt:
** DONE Choose a hosting provider :@office:
* Personal
** TODO Renew passport :errand:
flowchart TD
F["#+FILETAGS: :acme:"] -->|"acme"| P["Website relaunch :project: (level 1)"]
P -->|"acme, project"| M["Migrate the user table :backend:crypt: (level 2)"]
F -->|"acme"| Q["Personal (level 1)"]
Q -->|"acme"| R["Renew passport :errand: (level 2)"]
M --> MT["effective tags: acme project backend crypt"]
R --> RT["effective tags: acme errand"]
Figure 9.1: Each headline’s effective tags are its own tags plus everything that flows down from its ancestors and from FILETAGS.
The function org-get-tags returns the effective tags, and Org marks the inherited ones with a text property. Called on “Migrate the user table” in a batch run, it returned:
local: ("backend" "crypt")
all: (#("acme" 0 4 (inherited t)) #("project" 0 7 (inherited t)) "backend" "crypt")
Inheritance is usually what you want, but not always. 2 variables restrict it:
org-use-tag-inheritance(defaultt) can be nil to turn inheritance off, a list of tags that are inherited, or a regular expression that matches them.org-tags-exclude-from-inheritance(default nil) lists tags that are never inherited.
A typical candidate for exclusion is a tag that marks an action on one entry only. Org Crypt, for example, encrypts entries tagged crypt, and the manual’s setup for it excludes that tag so that children of an encrypted entry are not encrypted again:
(setq org-tags-exclude-from-inheritance '("crypt"))
Inheritance affects searches. In the agenda, tag-based views (tags, tags-todo) honor org-use-tag-inheritance when they select entries. Other agenda views select entries without tags, but still compute inherited tags so that you can filter by them later; the variable org-agenda-use-tag-inheritance (default (todo search agenda)) lists the views that do this, and setting it to nil makes those views faster.
Setting tags
You can type tags directly at the end of a headline, and M-TAB after a colon completes tag names. Usually, though, you use a command:
C-c C-q(org-set-tags-command) asks for the tags of the current headline and aligns them.C-c C-con a headline does the same.C-u C-c C-qrealigns the tags of every headline in the buffer.
Tags are right-aligned to the column in org-tags-column (default -77, where a negative value means “end at column 77”). Org realigns them automatically after promotion, demotion and state changes.
By default, completion offers every tag already used in the current buffer. For a controlled vocabulary, define the list yourself, either for all files with org-tag-alist or for one file with #+TAGS: lines:
#+TAGS: @office @home @phone
#+TAGS: laptop server
An empty #+TAGS: line switches a file back to the dynamic list even when org-tag-alist is set. Tags that should be available everywhere, in addition to each file’s own list, go into org-tag-persistent-alist; a file can ignore them with #+STARTUP: noptag. To complete over the tags of all agenda files instead of the current buffer, set org-complete-tags-always-offer-all-agenda-tags.
Fast tag selection
Typing tag names is slow when you tag dozens of entries a day. Fast tag selection assigns a single key to each tag, so that one keystroke toggles it. Give the keys in parentheses after the tag names:
#+TAGS: { @office(o) @home(h) } laptop(l) server(s)
or globally:
(setq org-tag-alist
'((:startgroup . nil)
("@office" . ?o) ("@home" . ?h)
(:endgroup . nil)
("laptop" . ?l) ("server" . ?s)))
Once at least one tag has a key, C-c C-c on a headline opens a selection window. It lists the inherited tags, the current tags and every defined tag with its key. Pressing a tag’s key adds or removes that tag; Org assigns keys automatically to tags that have none. Several keys have fixed meanings in this window:
| Key | Effect |
|---|---|
TAB | Type a tag in the minibuffer, including one that is not in the list; separate several with commas. |
SPC | Remove all tags from the headline. |
RET | Accept the changes. |
C-g | Cancel. q also cancels unless it is assigned to a tag. |
! | Suspend the mutually exclusive groups for this selection. |
C-c | Toggle automatic exit after the next change. |
The braces in the #+TAGS: line (or :startgroup and :endgroup in the variable) form a mutually exclusive group: selecting @home in the window removes @office, because a task cannot happen in two places. With the setup above, C-c C-c SPC h l RET replaces all tags with @home and laptop, and C-c C-c o RET switches the context to @office.
To break the window into rows, insert \n in a #+TAGS: line or :newline in the variable. If you usually change one tag at a time, set org-fast-tag-selection-single-key to t: the window then closes after the first key. Set it to expert and the window does not even appear unless you press an extra C-c. The number of tags shown is capped by org-fast-tag-selection-maximum-tags.
Tag hierarchies
Sometimes one tag is a broader term for several others. You might tag tasks backend or frontend, but also want to ask for “all development work”. A group tag expresses that relation. Square brackets define it, with a colon between the group tag and its members; the spaces around the brackets and the colon are required:
#+TAGS: [ dev : backend frontend ]
Searching for a group tag matches its members too. With the example file above, these searches gave the following results in a batch run (the function org-map-entries lists the headlines that match a search string):
dev => ("Design the landing page" "Migrate the user table")
-dev => ("Website relaunch" "Choose a hosting provider" "Personal" "Renew passport")
Neither headline carries the tag dev itself. Org expands the group into a regular expression over all members before matching, and a negated group excludes headlines that carry any member.
Groups can be nested, because a member can itself be a group tag. Members can also be regular expressions in braces, which suits tags that follow a naming pattern, such as one tag per project:
#+TAGS: [ Project : {P@.+} ]
* Kickoff meeting :P@atlas:
* Budget review :P@zephyr:
* Gym :health:
A search for Project returned ("Kickoff meeting" "Budget review"). With group tags disabled, the same search returned nil.
Both kinds of member combine into a hierarchy when a group tag lists other group tags:
#+TAGS: [ work : dev Project ]
#+TAGS: [ dev : backend frontend ]
#+TAGS: [ Project : {P@.+} ]
* Fix the API rate limit :backend:
* Kickoff meeting :P@atlas:
* Gym :health:
flowchart TD
W["work (group)"] --> D["dev (group)"]
W --> P["Project (group)"]
D --> B["backend"]
D --> FE["frontend"]
P --> R["{P@.+} (regex member)"]
R --> PA["P@atlas, P@zephyr, ..."]
Searching this file gave the following results in a batch run:
work => ("Fix the API rate limit" "Kickoff meeting")
dev => ("Fix the API rate limit")
Project => ("Kickoff meeting")
-work => ("Gym")
Figure 9.2: A tag hierarchy is a tree of group tags; searching for any group tag matches every tag beneath it, including tags that only match a regular expression.
A group can also be mutually exclusive if you use braces with a colon, as in #+TAGS: { Context : @office @home @phone }. In org-tag-alist, use :startgrouptag, :grouptags and :endgrouptag for an ordinary group, and :startgroup, :grouptags and :endgroup for an exclusive one:
(setq org-tag-alist
'((:startgrouptag) ("dev") (:grouptags)
("backend") ("frontend")
(:endgrouptag)))
C-c C-x q (org-toggle-tags-groups) turns group expansion off and on for the current session, and setting org-group-tags to nil disables it permanently. Since Org 9.8, org-tags-sort-function accepts the function org-tags-sort-hierarchy, which orders tags according to their hierarchy, and the variable may also hold a list of functions, applied in turn to break ties.
The variable org-tag-faces gives individual tags their own face, in the same way that org-todo-keyword-faces does for TODO keywords (see TODO Items).
Properties
The essential idea
A tag says “this entry belongs to a category”. A property says “this entry has this value for this attribute”: the owner is Ana, the estimate is 3 hours, the customer is Globex. Properties are stored in a PROPERTIES drawer, which must come directly after the headline (and after its planning line with SCHEDULED or DEADLINE, when there is one):
* TODO Fix login timeout :backend:
DEADLINE: <2026-11-21 Sat>
:PROPERTIES:
:Points: 2
:Customer: Globex
:END:
Each line holds one property: the key between colons, then the value. Keys are case-insensitive, so :Customer: and :CUSTOMER: name the same property.
Properties serve 2 purposes. First, they work like tags with values: one property Release with values 2.0 and 3.0 replaces a growing family of tags such as release_2 and release_3. Second, they turn a set of headlines into records with fields, which column view (later in this chapter) can display and edit as a table.
Editing properties
| Key | Command | Effect |
|---|---|---|
C-c C-x p | org-set-property | Ask for a key and a value, creating the drawer if needed. |
M-TAB | pcomplete | After a colon at the start of a line, complete property keys used in the file. |
C-c C-c in a drawer | org-property-action | Offer property commands: s sets, d deletes, D deletes from every entry in the file, c computes the value from the column definition. |
S-RIGHT, S-LEFT | org-property-next-allowed-value, org-property-previous-allowed-value | Cycle through the allowed values. |
To insert an empty drawer, use C-u M-x org-insert-drawer.
Allowed values
Free-text values invite typing errors: Globex, globex and GlobEx are 3 different values to a search. To restrict a property, define its allowed values in a property whose key ends with _ALL:
#+PROPERTY: Status_ALL todo review done
* Dune
:PROPERTIES:
:Status: todo
:END:
The _ALL property is inherited, so one definition near the top of a tree (or in the file header) covers everything below it. With point on the :Status: line, S-RIGHT steps to the next allowed value. Two presses in a batch run produced:
:Status: review
:Status: done
Values that contain spaces need double quotes in the _ALL list, for example "In progress".
File-wide and global properties
A #+PROPERTY: line sets a property for the whole file, as if it were defined above the first headline:
#+PROPERTY: Owner Ana
A property drawer at the very top of the file, before any headline and with only comments above it, does the same.
To add to a value instead of replacing it, append + to the key. Each + line contributes one more value, separated by a space. This works across levels as well:
#+PROPERTY: var foo=1
#+PROPERTY: var+ bar=2
* Library
:PROPERTIES:
:Genres: Fiction
:END:
** Dune
:PROPERTIES:
:Genres+: SF
:Genres+: Classic
:END:
For “Dune”, a batch run returned "foo=1 bar=2" for var and "Fiction SF Classic" for Genres when looking up with inheritance, but only "SF Classic" without inheritance. A key may appear more than once in a drawer only with the + suffix; the result of repeating a key without it is undefined.
The pattern is common in code blocks, where header-args properties accumulate settings (see Working with Source Code):
#+PROPERTY: header-args :results silent
#+PROPERTY: header-args+ :exports both
For defaults across all files, set org-global-properties, an alist of keys and values that every entry can inherit.
Property inheritance
Tags are inherited by default; properties are not. Looking up inherited values means walking up the tree for every entry, which slows down searches, and most properties describe one entry only. When you do want inheritance, turn it on selectively with org-use-property-inheritance. Its value can be t (all properties), a list of property names, or a regular expression:
(setq org-use-property-inheritance '("Release" "Customer"))
When a property is inherited, Org looks for the value in this order, and stops at the first one it finds:
flowchart LR
E["entry's own drawer"] -->|"not found"| A["parent, grandparent, ..."]
A -->|"not found"| K["#+PROPERTY lines and top drawer"]
K -->|"not found"| G["org-global-properties"]
G -->|"not found"| N["nil"]
Figure 9.3: An inherited lookup climbs from the entry through its ancestors to the file and finally to the global defaults; the first value found wins.
A value of nil in a drawer explicitly “undefines” a property: the lookup stops there and returns nil.
A few properties are always inherited for their own purpose, whatever org-use-property-inheritance says:
| Property | Purpose |
|---|---|
COLUMNS | The column view format for the subtree (see below). |
CATEGORY | The category shown in agenda lines (see Agenda Views). |
ARCHIVE | The archive location for the subtree (see Capture, Refile, Archive and Attachments). |
LOGGING | Logging settings for the subtree (see TODO Items). |
In Lisp, the function org-entry-get takes an inherit argument that makes the distinction visible. In a batch run on an entry whose parent defined Release as 3.0:
nil: nil
t: "3.0"
selective: nil
selective+var: "3.0"
With t the lookup always inherits; with selective it inherits only when org-use-property-inheritance allows it for that property, which was the case only in the last line.
Special properties
Much of what Org knows about an entry is not stored in a drawer: the TODO keyword, the priority, the tags, the deadline. Org exposes these as special properties, read-only names that you can use in searches and in column view exactly like real properties. Do not use these names as keys in a drawer.
| Property | Value |
|---|---|
ITEM | The headline text. |
TODO | The TODO keyword. |
PRIORITY | The priority, as a single character. |
TAGS | The tags written on the headline. |
ALLTAGS | All tags, including inherited ones. |
BLOCKED | t if the task is blocked by dependencies (see TODO Items). |
CATEGORY | The category of the entry. |
FILE | The file name. |
DEADLINE, SCHEDULED, CLOSED | The corresponding timestamps. |
TIMESTAMP, TIMESTAMP_IA | The first active or inactive timestamp in the entry that is not part of a planning line. |
CLOCKSUM, CLOCKSUM_T | The clocked time of the subtree, overall and for today, after org-clock-sum or org-clock-sum-today has run (see Clocking, Effort and Timers). |
org-entry-properties returns both kinds. For “Port the CLI” in the release file shown later in this chapter, it returned the following (the absolute file name is shortened here):
(("CATEGORY" . "props") ("DONE" . "[X]") ("ESTIMATE" . "1-2") ("EFFORT" . "3:30")
("OWNER" . "Ben") ("BLOCKED" . "") ("FILE" . "...")
("PRIORITY" . "B") ("TODO" . "TODO") ("ITEM" . "Port the CLI"))
Note that the priority is reported as B even though the headline has no cookie: the special property reflects the default priority.
Searching with match strings
Tags and properties become useful when you can ask questions about them. Org uses one small query language, the match string, for all such questions. The same string works in three places:
C-c / morC-c \(org-match-sparse-tree) shows the matching headlines of the current buffer as a sparse tree; withC-u, only TODO entries.min the agenda dispatcher (org-tags-view) collects matches from all agenda files;Mrestricts the result to TODO entries.- The
:matchparameter of a column view dynamic block, custom agenda commands, and the Lisp functionorg-map-entries.
For a quick search on one property, C-c / p asks for a property name and a value and builds a sparse tree; a value in braces is treated as a regular expression.
Grammar
A match string is a list of alternatives separated by |. Each alternative is a list of terms that must all hold. A term is preceded by + (must match) or - (must not match); between terms without a sign you can write &. & binds more tightly than |, and there are no parentheses. Finally, an optional part after / tests TODO keywords.
flowchart LR
S["match string"] -->|"split at the pipe"| A["alternatives (OR)"]
A -->|"split at + - and"| T["terms (AND), each + or -"]
T --> TG["tag: backend"]
T --> RX["tag regexp: {^@}"]
T --> PR["PROP OP VALUE"]
S -->|"optional / part"| TD["TODO keywords: /!-WAIT"]
PR --> V["number, quoted string, quoted date, {regexp}"]
Figure 9.4: A match string is OR over AND: alternatives split at the pipe symbol, terms inside an alternative are combined with AND, and each term tests a tag, a tag regexp or a property.
Tag terms
Using the example file from the tags section (which has acme as a file tag), a batch run of org-map-entries returned:
project => ("Website relaunch" "Design the landing page" "Migrate the user table" "Choose a hosting provider")
acme-project => ("Personal" "Renew passport")
{^@} => ("Design the landing page" "Choose a hosting provider")
crypt => ("Migrate the user table")
LEVEL=2+@home|errand => ("Design the landing page" "Renew passport")
project/! => ("Design the landing page" "Migrate the user table")
-project+acme/-DONE => ("Personal" "Renew passport")
Each line deserves a short explanation:
projectmatches the headline that carries the tag and all its descendants, which inherit it.acme-projectkeeps the file tag and removes everything inside the project.{^@}is a regular expression over tag names: here, every headline with a context tag.LEVEL=2+@home|errandshows 2 alternatives; the first combines the special propertyLEVEL(the outline level) with a tag.project/!keeps only entries with a not-done TODO keyword; the!after the slash restricts the TODO part to not-done states.-project+acme/-DONEcombines tag terms with a negative TODO test.
Property terms
A property term has the form PROPERTY OPERATOR VALUE. The operators are =, <>, <, >, <= and >= (with == as a synonym for =, and != and /= for <>). How the comparison works depends on the way you write the value:
| Value written as | Comparison | Example |
|---|---|---|
| A plain number | Numeric | Points>=3 |
| A string in double quotes | String | Customer="Globex" |
| A date in double quotes and angle brackets | Time | DEADLINE<="<+7d>" |
| A regular expression in braces | = matches, <> does not match | Customer={^Glo} |
The date form accepts "<now>", "<today>", "<tomorrow>" and relative offsets such as "<+5d>" or "<-2m>" with the units d, w, m and y.
Every operator can be followed by *, as in <* or <>*. A starred operator matches only entries where the property actually exists. This matters for negative or “less than” tests, where a missing property would otherwise count as matching. The following file shows the difference:
* TODO Fix login timeout :backend:
DEADLINE: <2026-11-21 Sat>
:PROPERTIES:
:Points: 2
:Customer: Globex
:END:
* TODO Redesign settings page :frontend:
DEADLINE: <2026-12-15 Tue>
:PROPERTIES:
:Points: 8
:Customer: Initech
:END:
* WAIT Upgrade the CI runners :ops:
* DONE Write the API docs :backend:
:PROPERTIES:
:Points: 3
:END:
A batch run on 19 November 2026, with the keywords TODO, WAIT and DONE, returned:
Points<5 => ("Fix login timeout" "Upgrade the CI runners" "Write the API docs")
Points<*5 => ("Fix login timeout" "Write the API docs")
Customer<>"Globex" => ("Redesign settings page" "Upgrade the CI runners" "Write the API docs")
Customer<>*"Globex" => ("Redesign settings page")
Customer={^Glo} => ("Fix login timeout")
DEADLINE<="<+7d>" => ("Fix login timeout")
backend-TODO="DONE" => ("Fix login timeout")
/WAIT => ("Upgrade the CI runners")
-ops/!-WAIT => ("Fix login timeout" "Redesign settings page")
TODO={TODO\|WAIT} => ("Fix login timeout" "Redesign settings page" "Upgrade the CI runners")
“Upgrade the CI runners” has no Points property, so the unstarred Points<5 treats it as 0 and includes it, while Points<*5 leaves it out. The same applies to Customer<>"Globex".
Numeric comparison reads only the leading number of a value. A duration such as 3:30 compares as 3, and 45 (minutes) compares as 45, so do not use numeric operators on time values such as Effort. For those, use column view summaries or the agenda’s effort filters (see Clocking, Effort and Timers).
Property names that contain characters other than letters, digits and underscores must escape those characters with a backslash in a match string: boss\-prio="C". If inheritance is enabled for a property in org-use-property-inheritance, matching also sees inherited values, with the speed cost mentioned earlier.
Column view
The essential idea
Once your entries carry properties, you will want to see them side by side. Column view displays a subtree as a table: each headline becomes a row and each column shows one property. Org does this with overlays, so the file itself does not change, and you can still fold and unfold the outline while the table is active. You can also edit values directly in the table.
C-c C-x C-c (org-columns) turns column view on. It looks upward from point for a COLUMNS property and uses the subtree where it found one; if there is none, it uses the #+COLUMNS: line of the file or org-columns-default-format, whose default is %25ITEM %TODO %3PRIORITY %TAGS. Before the first headline, it shows the whole file. q (or C-c C-c when point is not on a checkbox) turns it off, and g or r refreshes it after edits made elsewhere.
Defining columns
A column format is a list of column definitions, each with the following shape:
%[WIDTH]PROPERTY[(TITLE)][{SUMMARY-TYPE}]
Only the percent sign and the property name are required. WIDTH fixes the width in characters, TITLE replaces the property name in the header, and SUMMARY-TYPE tells Org to compute the value of a parent row from its children.
Put the format in a COLUMNS property at the top of the tree where it applies, or in a #+COLUMNS: line for the whole file. A COLUMNS property applies to its entry and the entire subtree, so you can define a general format at level 1 and more specific ones deeper down.
Here is a small release plan, used for the rest of this section:
#+PROPERTY: Owner_ALL Ana Ben Chen
* Release 3.0
:PROPERTIES:
:COLUMNS: %30ITEM %TODO %Owner %Effort{:} %Estimate{est+} %Done{X/}
:Release: 3.0
:ID: release-3
:END:
** TODO Rewrite the parser
:PROPERTIES:
:Owner: Ana
:Effort: 6:00
:Estimate: 2-4
:Done: [ ]
:END:
** TODO Port the CLI
:PROPERTIES:
:Owner: Ben
:Effort: 3:30
:Estimate: 1-2
:Done: [X]
:END:
** DONE Update the docs
:PROPERTIES:
:Owner: Chen
:Effort: 1:15
:Estimate: 0.5-1
:Done: [X]
:END:
Summary types
A summary type aggregates the values of the direct children into the parent row. The most useful ones:
| Type | Result |
|---|---|
+ | Sum of numbers. +;%.1f formats the sum; $ is short for +;%.2f. |
min, max, mean | Smallest, largest, average number. |
: | Sum of times such as 1:30; plain numbers count as minutes. :min, :max, :mean work on times. |
X | [X] if all children are checked. |
X/, X% | Count of checked children, as [n/m] or [n%]. |
@min, @max, @mean | Minimum, maximum or average age of timestamps. |
est+ | Combination of low-high estimates. |
The est+ type needs a word of explanation. An estimate such as 2-4 says “between 2 and 4 days”. Adding the lower and upper bounds of many such ranges produces an interval that is far too wide, because it assumes that every task goes either perfectly or terribly. est+ instead adds up the mean and variance of each range, and reports the combined mean minus and plus one standard deviation, rounded to whole numbers. You can define further summary types in org-columns-summary-types. Summary types are ignored for special properties.
Summaries are recursive: Org computes the deepest level first and works upward, so a grandparent summarizes its children’s summaries.
When the parent heading already has the summarized property, Org does not just display the computed value: it overwrites the value in the parent’s drawer. In a batch test, a parent with :Effort: 1:00 and children with 2:00 and 0:30 had its drawer changed to :EFFORT: 2:30 after org-columns. Do not keep hand-written values in a parent for a property that the format summarizes.
Editing in column view
Column view is also an editor. With point on a field:
| Key | Command | Effect |
|---|---|---|
LEFT, RIGHT, UP, DOWN | Move between fields. | |
S-RIGHT/n, S-LEFT/p | org-columns-next-allowed-value, org-columns-previous-allowed-value | Cycle through the allowed values. |
1 to 9, 0 | Select the first to ninth allowed value, or the tenth with 0. | |
e | org-columns-edit-value | Edit the value; for special properties, the usual interface (such as tag selection) appears. |
v | org-columns-show-value | Show the full value of a truncated field. |
a | org-columns-edit-allowed | Edit the list of allowed values. |
C-c C-c | org-columns-toggle-or-columns-quit | Toggle a checkbox, or quit column view. |
<, > | org-columns-narrow, org-columns-widen | Make the column narrower or wider. |
S-M-RIGHT, S-M-LEFT | org-columns-new, org-columns-delete | Insert or delete a column. |
M-LEFT, M-RIGHT | org-columns-move-left, org-columns-move-right | Move the column. |
M-UP, M-DOWN | org-columns-move-row-up, org-columns-move-row-down | Move the row. |
Allowed values (_ALL properties) make editing much faster here: with Owner_ALL defined as above, 1, 2 and 3 set the owner to Ana, Ben and Chen. Column view also works in the agenda, where it shows entries collected from many files (see Agenda Views).
Capturing column view in a dynamic block
Column view is an overlay, so it does not appear in exports or printouts. To keep a copy of the table in the document, insert a columnview dynamic block: a block between #+BEGIN: and #+END: lines whose contents Org regenerates on request. C-c C-x x (org-dynamic-block-insert-dblock) followed by columnview inserts one, and org-columns-insert-dblock does the same directly.
* Status table
#+BEGIN: columnview :id "release-3" :indent t :hlines 1
#+END:
With point on the #+BEGIN: line, C-c C-c or C-c C-x C-u (org-dblock-update) fills the block. A batch run on the release plan produced:
* Status table
#+BEGIN: columnview :id "release-3" :indent t :hlines 1
| <30> | | | | | |
| ITEM | TODO | Owner | Effort | Estimate | Done |
|------------------------+------+-------+--------+----------+-------|
| Release 3.0 | | | 10:45 | 4-6 | [2/3] |
| \_ Rewrite the parser | TODO | Ana | 6:00 | 2-4 | [ ] |
| \_ Port the CLI | TODO | Ben | 3:30 | 1-2 | [X] |
| \_ Update the docs | DONE | Chen | 1:15 | 0.5-1 | [X] |
#+END:
The parent row shows the summaries: the efforts add up to 10:45, 2 of 3 tasks are checked, and est+ combines the three ranges (whose plain sums would be 3.5 to 7) into 4 to 6. The first row holds the width cookie <30> that came from the %30ITEM definition.
flowchart LR
C["COLUMNS property or #+COLUMNS"] -->|"format"| O["org-columns: live overlay"]
P["properties in the subtree"] -->|"values"| O
O -->|"edits"| P
C -->|"format"| B["columnview block"]
P -->|"values"| B
B -->|"C-c C-c"| T["static Org table, exportable"]
Figure 9.5: The same column definition feeds 2 outputs: an editable overlay on the outline, and a dynamic block that freezes the current values into an ordinary table.
The parameters of the block decide what it captures:
| Parameter | Meaning |
|---|---|
:id | Which tree: local (the tree containing the block), global (the whole file), file:NAME (another file), or the value of an ID property. |
:match | A match string that selects a subset of the headlines. |
:maxlevel | Ignore entries deeper than this level. |
:hlines | t for a rule after every row, or a number N for a rule before each headline of level N or less. |
:vlines | Draw vertical lines between column groups. |
:indent | Indent ITEM according to the outline level. |
:link | Make each ITEM a link to its headline. |
:skip-empty-rows | Leave out rows whose only value is ITEM. |
:exclude-tags | Leave out entries with any of these tags. |
:format | Use this column format instead of the one in effect. |
:formatter | A function that writes the table; the default comes from org-columns-dblock-formatter. |
The :id value release-3 in the example refers to the ID property of the release headline; M-x org-id-copy creates such an identifier for the current entry and copies it (see Hyperlinks). Formulas in a #+TBLFM: line after the table survive updates, and Org recalculates them after each update (see The Spreadsheet and Plotting).
The command org-update-all-dblocks, bound to C-u C-c C-x C-u, refreshes every dynamic block in the file. Clock tables use the same block mechanism (see Clocking, Effort and Timers), and you can write your own block types in Lisp (see Hacking and Extending Org).
Choosing between tags and properties
Both mechanisms attach metadata to headlines, and many facts could be stored either way. The following rules of thumb work well:
| Prefer tags when | Prefer properties when |
|---|---|
The fact is a yes-or-no label (@office, urgent). | The fact has a value (Owner: Ana, Points: 3). |
| It should be visible on the headline itself. | It is detail that can stay folded in a drawer. |
| It should apply to all children automatically. | It describes one entry, or you enable inheritance for it. |
| You filter the agenda by it often. | You compare, sort or sum it (column view, numeric matches). |
Remember also that a single match string can combine both, as in backend+Points>=3/!.
Summary
- Tags are labels at the end of a headline; they are inherited down the tree and from
#+FILETAGS:. C-c C-qorC-c C-csets tags; selection keys in#+TAGS:ororg-tag-alistenable fast tag selection, and braces define mutually exclusive groups.- Group tags in square brackets build a hierarchy that searches expand automatically.
- Properties are key-value pairs in a
PROPERTIESdrawer;_ALLlists allowed values,+appends, and#+PROPERTY:sets file-wide values. - Property inheritance is off by default and enabled per property with
org-use-property-inheritance. - Special properties such as
TODO,PRIORITYandALLTAGSexpose built-in metadata to searches and columns. - Match strings combine tags, properties and TODO keywords; starred operators require the property to exist.
- Column view shows properties as an editable table with summaries, and a
columnviewdynamic block captures it in the document.
Further reading
- Official manual: Tags, Tag Inheritance, Setting Tags, Tag Hierarchy, Tag Searches, Properties and Columns, Property Syntax, Special Properties, Property Searches, Property Inheritance, Column View, Defining columns, Column attributes, Using column view, Capturing column view, Matching tags and properties, Dynamic Blocks.
- Source at release 9.8.13: lisp/org.el (tags, properties and the match compiler
org-make-tags-matcher), lisp/org-colview.el (column view and thecolumnviewblock).