This page is part of a static HTML representation of the TiddlyWiki at https://tiddlywiki.com/

Filter Filter Run Prefix

 10th July 2023 at 7:33am
purposeremove every input title for which the filter run output is an empty list
inputthe filter output of all previous runs so far
outputthe input titles for which the filter run is not empty
Introduced in v5.1.23
:filterrun

It receives the filter output so far as its input. The next run is evaluated for each title of the input, removing every input title for which the output is an empty list.

Note that within the filter run, the currentTiddler variable is set to the title of the tiddler being processed. This permits filter runs like :filter[{!!price}multiply{!!cost}compare:integer:gteq[5]] to be used for computation. The value of currentTiddler outside the run is available in the variable ..currentTiddler.

The following variables are available within the filter run:

  • currentTiddler - the input title
  • ..currentTiddler - the value of the variable currentTiddler outside the filter run.
  • index - Introduced in v5.2.1 the numeric index of the current list item (with zero being the first item in the list).
  • revIndex - Introduced in v5.2.1 the reverse numeric index of the current list item (with zero being the last item in the list).
  • length - Introduced in v5.2.1 the total length of the input list.

Tip
Compare named filter run prefix :filter with filter Operator which applies a subfilter to every input title, removing the titles that return an empty result from the subfilter

Filter Filter Run Prefix (Examples)