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

lookup Operator

 16th January 2021 at 8:13am
purposeapplies a prefix to each input title to yield the title of a tiddler from which the final value is retrieved. With a single parameter, the default field is "text" and the default index is "0". If a second parameter is provided, that becomes the target field or index.
inputa selection of titles
suffixD, I = the default value to be used for missing lookups. This operator can now accept a second suffix of :index, see below for details
parameterP, T = prefix applied to input titles to yield title of lookup tiddler from which value is retrieved. Now accepts 1 or 2 parameters, see below for details
outputthe lookup values corresponding to each lookup tiddler
Learn more about how to use Filters

New in: 5.1.15

The action of this operator is as follows with 1 parameter:

  • Apply the specified prefix to each input tiddler title, yielding a new list of tiddler titles
  • Transclude the value of the text field each of those tiddlers
    • Substitute the default value for missing or empty values
  • Return the list of values

New in: 5.2.2

The use of the :index second suffix changes the default lookup location from field: text to index: 0. This is used if no 2nd parameter is provided.

The action of this operator is as follows with 2 parameters:

If there are two parameters provided, use the second parameter as the target field or index.

Note
If there is only one parameter given, the filter checks for a second suffix equal to "index". If this suffix is found, the default target index is "0".

In all other cases, the default target field is "text".

Then:

  • Apply the specified prefix to each input tiddler title, yielding a new list of tiddler titles
  • Transclude the value of the target field or index
    • Substitute the default value for missing or empty values
  • Return the list of values

Examples