Hi y’all!
How do I list all non-empty fields of a tiddler? The intuitive way would be the following but with perhaps some suffix for fields
:
[<currentTiddler>fields[]]
…but, nope, not possible. (This can be contrasted to has op which does feature an optional suffix to distinguish fields with vs without values.)
The following complexity does work… but come on it is way too convoluted:
[<currentTiddler>fields[]] :map[<..currentTiddler>has<currentTiddler>then<currentTiddler>] +[!is[blank]]
(Yes, +[!is[blank]]
is needed and it must not be baked into the previous run. You can test this by creating two custom fields; one empty one one with value, and add a final +[count[]]
to the filer. Apparently the preceding steps output also empty stuff, perhaps what is explained for the split op docs.)
Unless I’m missing something, I’m going to propose a fields[]
suffix to remedy this, but I would appreciate a decent solution meanwhile or to at least hear that “yeah, that little monster is currently the way to do it”.
Thanx!
P.S
You haven’t seem much of me for these past months due to work. It’s like employers refuse to understand that tiddlyfiddling is more important. Hopefully the work vs tiddly ratio will go back to normal very soon.