You can do this by setting org-columns-modify-value-for-display-function
, but you'd have to parse the logbook yourself.
Say you have an Org file looking like this:
:PROPERTIES:
:COLUMNS: %20ITEM %TODO %PROP1 %TSNOTE1 %NOTE1
:END:
* TODO task 1
:PROPERTIES:
:PROP1: val1
:END:
:LOGBOOK:
- Note taken on [2023-01-17 Tue 21:16] \\
My second note.
- Note taken on [2023-01-17 Tue 21:15] \\
My first note.
:END:
* TODO task 2
:PROPERTIES:
:PROP1: val1
:END:
:LOGBOOK:
- Note taken on [2023-01-17 Tue 02:20] \\
A more recent note.
- Note taken on [2023-01-17 Tue 02:19] \\
Another note.
:END:
Then the following code will show the timestamp and first line of the most recent logbook note in the columns TSNOTE1 and NOTE1:
(defun my-column-display-value-transformer (column-title value)
"Modifies the value to display in column view."
(when (and (member column-title '("TSNOTE1" "NOTE1"))
(org-back-to-heading)
(re-search-forward
"Note taken on \\[\\(.*\\)\\] \\\\\\\\\\\n +\\(.*\\) *$"
(org-entry-end-position) t))
(if (equal column-title "TSNOTE1")
(match-string-no-properties 1)
(match-string-no-properties 2))))
(setq org-columns-modify-value-for-display-function
#'my-column-display-value-transformer)
After enabling column view (M-x org-columns
) it will look like this:
