Create the lookupValue Function

You can create the parameter values for the lookupValue function with the Map Lookup Value wizard. This wizard enables you to define the lookup table, source column, target column, and default value to use in the function. For these parameter values to be selectable in the wizard, you must have already created a lookup on the Lookups page.

Access the Build Lookup Function Wizard

The Map Lookup Value wizard for creating the lookupValue function parameter values is accessible from the mapper or the Expression Builder in actions that support functions in Oracle Integration.

Note:

You must already have created lookups to use this wizard.

From the Mapper

  1. In the upper right corner, click Toggle functions Mapper functions icon to launch the Components panel.
  2. Type lookupValue in the Search field, and click Search.
  3. Drag the function onto the target element node.

    The Map Lookup Value wizard is displayed.


    The Map Lookup Value panel shows the wizard steps at the top: Select Lookup, Select Columns, Select Default, and Summary. Below are the lookup names, the number of columns, and the information icons.

From the Expression Builder in an Action that Supports Functions

You can access the Map Lookup Value wizard in the Expression Builder in an action that supports functions, such as a switch, stitch, or others.

  1. Open an integration for editing.

  2. Open an action that supports functions in the integration (for this example, a switch action is shown, but other actions such as a stitch can be used).

    The Configure Route panel opens.

  3. Manually enter a value, select a value from the drop-down list, or drag a value from the Sources tree to the first Value field. For this example, tracking_var_1 is selected.
  4. Select an operator in the Operator field.
  5. Click Functions, and browse or search for lookupValue.

  6. Click lookupValue.
  7. View the description below the function for information about the supported parameters. You define values for these parameters in the Map Lookup Value wizard.
    • dvm-location

    • src-column

    • src-value

    • target-column

    • default-value

  8. Click Switch to Developer Mode Switch view icon in the second Value field.
  9. Drag the lookupValue function into the second Value field.


    The lookupValue function is dragged to the second Value field in the Configure Route panel.

    The Map Lookup Value wizard is displayed.


    The Map Lookup Value panel shows the wizard steps at the top: Select Lookup, Select Columns, Select Default, and Summary. Below are the lookup names, the number of columns, and the information icons.

    Create the lookupValue function parameter values.

Select the Lookup

You can select the lookup to use in the lookupValue function. You must already have created a lookup. Otherwise, no lookups are displayed for selection.

  1. Select the lookup to use in the function. You can view the lookup description by clicking the information icon in the row. This can guide you in selecting the required lookup. The number of columns defined in the lookup is also displayed.

  2. Click >.

Select the Source and Target Columns

You can select the source and target columns to use in the lookupValue function. The lookupValue function requires one source column and one target column. When you select a source and target column, the values available with the columns are displayed.

  1. Select the source and target columns to use in the lookupValue function.
    Element Description

    Select Source

    Click the source column header to select from a list of available columns for this lookup table. The data included with the selected column is displayed. Both adapter and domain name columns are displayed.

    Select Target

    Click the target column header to select from a list of available columns for this lookup table. The data included with the selected column is displayed. Both adapter and domain name columns are displayed.

  2. Click >.

Specify the Default Value

You must specify a default value to use.

  1. Enter the default value to use in the lookupValue function if no match is found. If there is no match that satisfies all the search values, the lookup fails and the default value is returned (for example, an actual default value to use or an error message such as No Value Found).
  2. Click >.

Review Your Lookup Table Selections

You can review the lookup table values to use in the lookupValue function on the Summary page.

  1. Review the lookup table values. The Summary page is the final wizard page after you have completed your configuration.
    Element Description

    Parameter and Value Table

    Displays a summary of the parameters and values you defined on previous pages of the wizard.

    To return to a previous page to update any values, click the appropriate tab in the left panel or click Back Back icon.

    Resulting Expression

    Displays the expression you defined on the previous pages of the wizard. The lookupValue function takes the following format:

     lookupValue(dvm-location, src-column, src-value, target-column, default-value)

    Where:

    • Lookup Table: The lookup table selected on the Select Lookup page.

    • Source Column: The source column selected on the Select Columns page.

    • Source Value: The source value you enter in the mapper or Expression Builder after completing this wizard. Complete this wizard, then define the srcValue parameter value.

    • Target Column: The target column selected on the Select Columns page.

    • Default Value: The default value entered on the Default Value page.

    For example, a defined lookupValue function after you have completed the wizard and defined the srcValue parameter value in the Expression Builder can look as follows:
    dvm:lookupValue('countrycode', 'countrycode', srcValuePlaceHolder, 'name',
        'No data found')

    For example:


    The Select Lookup, Select Columns, Select Default, and Summary icons are shown. Below this is the Summary section. Below this is the lookup selected (countrycode) and the parameter and value assigned. Below this is the resulting expression. Below this are Cancel and Done buttons.

  2. Click Done.
  3. In the Sources tree, drag a value to replace srcValuePlaceHolder in the Value field.


    The Input Sources tab (selected) and Functions tab are shown. The $tracking_var_1 element is selected. On the right side is the Value field, Operator field, and Value field. In the second value field, $tracking_var_1 is being dropped on srcValuePlaceHolder in the expression.

  4. Click Save.

    You can use the configured function in the mapper. See Add Functions, Operators, and XSLT Statements in Using the Oracle Mapper with Oracle Integration 3.