A Filter that returns tiddlers with a field that is empty

60 views
Skip to first unread message

TonyM

unread,
Jul 25, 2018, 9:30:30 PM7/25/18
to TiddlyWiki
Folks,

As documented here https://tiddlywiki.com/#field%20Operator the "has" operator does not seem to have a way to filter that returns tiddlers with a field, that is empty.

We can force it to return fields that are empty along with those that are not empty, 
but to get a list of tiddlers that have a field but are also empty seems impossible without a nested list and testing the contents of a field using the get operator.

Does anyone have a tricky way of using a single filter to list such tiddlers?

I think this may be an issue to raise in the GitHub issues.

Regards
Tony

TonyM

unread,
Jul 25, 2018, 9:54:01 PM7/25/18
to TiddlyWiki
I have answered my own question;

The filter will be

[has:field[fieldname]]+[!has[fieldname]]

It works on the basis that [has:field[fieldname]] returns all tiddlers with fieldname blank or otherwise
and that [!has[fieldname]] only returns tiddlers without fieldname having a value or even having the fieldname.
To satisfy both conditions the fieldname must exist but be empty.

Rergards
Tony

TonyM

unread,
Jul 26, 2018, 12:12:57 AM7/26/18
to TiddlyWiki
To assist future visitors

The opposite, has field with any value
is simply [is[current]has[fieldname]]

But an older example given to me was something like this

<<list-links "[is[current]has[created]sort[created]] [is[current]!has[created]]">> 

But I am not so clear on this.

Regards
Tony
Reply all
Reply to author
Forward
0 new messages