Skip to main content
Version: 4

Mapping the key with Target Element

Steps to use the Key Function

  1. Ensure that the source and destination layout are loaded and all their elements are listed under their respective nodes

  2. Map source and target elements as displayed in figure below 

  3. Click the parent node (e.g. Record) of the target element and apply the For Each for parent node (e.g. Record) of Layout Source1***.


  4. Create a local variable at Record level of the Destination Layout. For e.g, Select id element of Source1 layout as the value of the variable. For more details refer to this page. 

  5. Click target element (e.g. address) on which you want to apply the key.

  6. Click Mapping Expression to expand the Mapping Functional Panel. 

  7. Click the Aggregation mapping function and select the Key sub-function.
    The syntax of the key function in the textual rules pane will be displayed as: key ( , )

  8. Place the cursor, at the first argument of key function and double-click the required key that you want to apply, from Keys in the Parameters Panel. This is the first argument for the key function.

  9. Place the cursor at the second argument of key function and double click the required local variable (under Local/Ancestor Variables) in the Parameters Panel. This is the second argument for the key function.

  10. Append the name of the element (address), of the Source2 schema, which needs to be mapped to the target element (address).

    Now the syntax of the mapping will be displayed as:

    key ('Key1'*, $*idSource1)/address 

  11. Apply For Each on element address of target schema from Root level of Source2 schema. This will execute key in the context of second source schema (i.e. Source2).

  12. Save the mapping activity and exit the Data Mapper.