IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Defining and transforming data > Transforming data > Transforming data using XML maps > Functions and transforms > IBM supplied transform types

XML transform: Lookup

Retrieve values from a file based on a key from the input element. The output element is populated with the retrieved value. You can use several file formats to perform this type of lookup. The map editor provides lookups for some formats.

You can also contribute support for your own custom file types.

The files used for looking up values must already exist in the workspace within the current module or in a library.

The map editor provides the following types of lookups:

Relationship lookup

takes an input and uses a defined static relationship in order to produce a target value. The transform takes a single input element and a single output element. Both input and output elements must be simple XSD type elements. If no output is defined for the provided input, the value of property "com.ibm.wbit.mapping.xml.lookup.default" defined on the output role is used, or an empty string is used, if no property of that name is defined.

Properties file

uses an existing properties file that contains a list of keys and values. The properties file must have a key= value format. The key must not contain the = character. The properties file specification is the same as the java.util.Properties class. The file must have a .properties extension.

Comma Separated Value File Lookup

retrieves values from a comma separated value file where the format is token,token....

If you want to use a comma in one of the token strings, precede the comma with the escape character forward slash /.

Because a lookup takes a source as input and produces a value for the target, you can control the index in the CSV file used to match the key and the index from which the value is returned. To specify the index, use the Column index setting. The first index is zero. You can also use a heading name and the index of the given header name will be used as the index. If a heading name is used, it is assumed that the first line of the csv file has the headings for the subsequent rows.

For example, suppose this is your comma separated file:

ID, City, Country
A001, Vienna, Austria
B020, Dhaka, Bangladesh
C005, Beijing, China

If you want to input an ID and set the country in the target, set the source column index to 0 and the target value column index to 2. If the input element has the value A001 the value set in the target is Austria.

Custom lookup

You can create your own custom lookup engine. See Create a custom lookup .

IBM supplied transform types in the XML map editor