No-op filter expression

64 views
Skip to first unread message

soren.b...@gmail.com

unread,
Nov 19, 2020, 2:39:01 PM11/19/20
to TiddlyWiki
Is there a best practice for creating a filter step (or entire filter run) that doesn't do anything (passes inputs through to outputs)?

My use case: I'm using the subfilter operator where the subfilter is pulled from a temp tiddler controlled by a checkbox. When the checkbox is checked, I want to apply an additional filter; when it's unchecked I want no additional criteria on top of what's already in the filter run before coming to subfilter. I tried just leaving the temp tiddler blank, but that causes there to be no results since an empty filter always has no output.

I got it to work using search[] for the no-filter condition, but I'm not sure if there's a cleaner way to do this. Instinctively it feels like that could be a bit slow, too, depending on the implementation.

TW Tones

unread,
Nov 19, 2020, 4:55:33 PM11/19/20
to TiddlyWiki
Soren,

Without looking into this in detail I often make use of the fact that title must exist if the tiddler exists
so !has[title]] will never be true for a tiddler, or has[title]] if it exists.

It seems to me when you say a filter that does nothing your are suggestion it does not filter, perhaps try is[blank] !is[blank] match[impossiblestring] or make use of the ten else operators.

Tones

Jens Odborg

unread,
Nov 20, 2020, 3:31:08 AM11/20/20
to TiddlyWiki
Use is operator without parameter:  [is[]]
Reply all
Reply to author
Forward
0 new messages