3.23

@@Lookup

@@Lookup lets you map values from tokens in the Record XML to user-defined values. @@Lookup is often used in combination with @@Define to create a custom token holding the user-defined value. @@Lookup is most commonly used as a way to translate cryptic token values into a more human-readable format.

Syntax:

@@Lookup(<source>, <map>)

Parameters:

<source>

The location in the xml providing the input value for the mapping, specified as #dataset.node. You can append an [i] after the node to have the document processor index all nodes in the dataset, allowing you to reference a specific node in your defined token. Specify the desired node by placing its numerical position within the dataset in brackets.

<map>

How the values from the source should display in the document. The map is an array of pairs of input values and output values. The input is the value read from the token, and the output is the corresponding value placed in the document. The array is enclosed in brackets [ ] , with input and output separated by a comma (,) and each input/output pair separated by a semicolon (;). Output can be a token. Input and output that are literal text values must be placed within single quotes.

 

Example

XML:

<Options>
    <Option>
        <SpTerminalExtTerm>03MP</ SpTerminalExtTerm>
    </Option>
<Option>
        <SpTerminalExtTerm>L12D</ SpTerminalExtTerm>
    </Option>
</Options>

 

Coding:

@@Define #SpTLO @@LookUp(#Options.Option[i].SpTerminalExtTerm, [‘03MO’, ‘3 Mos. TLO’; ‘06MO’, ‘6 Mos. TLO’; ‘12MO’, ’12 Mos. TLO’; ‘03MP’, ‘3 Mos. TLO Plus’; ‘06MP’, ‘6 Mos. TLO Plus’; ‘12MP’, ’12 Mos. TLO Plus’; ‘L03D’, ‘3 Mos. Lump Sum TLO w/ Ded Reset’; ‘L06D’, ‘6 Mos. Lump Sum TLO w/ Ded Reset’; ‘L12D’, ’12 Mos. Lump Sum TLO w/ Ded Reset’; ‘L03N’, ‘3 Mos. Lump Sum TLO w/o Ded Reset’; ‘L06N’, ‘6 Mos. Lump Sum TLO w/o Ded Reset’; ‘L12N’, ’12 Mos. Lump Sum TLO w/o Ded Reset’]) 

@@Include

Lookup Result for Option 1: #SpTLO[1]

@@End

Output:

Lookup Result for Option 1: 3 Mos. TLO Plus