This page is part of a static HTML representation of the TiddlyWiki at

Map Filter Run Prefix

18th June 2021 at 1:47pm

New in: 5.2.0

purposemodify input titles by the result of evaluating this filter run for each item
inputall titles from previous filter runs
outputthe input titles as modified by the result of this filter run

Each input title from previous runs is passed to this run in turn. The filter run transforms the input titles and the output of this run replaces the input title. For example, the filter run [get[caption]else{!!title}] replaces each input title with its caption field, unless the field does not exist in which case the title is preserved.

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

Filter runs used with the :map prefix should return the same number of items that they are passed. Any missing entries will be treated as an empty string. In particular, when retrieving the value of a field with the get Operator it is helpful to guard against a missing field value using the else Operator. For example [get[myfield]else[default-value]....