Saturday 23 June 2018

Oracle ICS : How to use Lookups in integrations - lookupValue function



To use a lookup in your integration, ICS provides a function : lookupValue which is configured with the Build Lookup Function wizard.

You may have already created a lookup on the Lookups page.
On steps how to create a lookup you can follow the blog page: Oracle ICS : How to create Lookups

Below are the steps to access and use a lookup.

1. Build Lookup Function Wizard:
  a. Go to and open your Integration (Edit mode)
  b. Open the Expression Builder (in mapping, assign, filter and other flow actions)













   c. Expand Components   
   d. Expand Functions > ICS
   e. Drag the lookupValue function into your expression box

You can also search for 'lookupValue' in the search box for Components.

The Build Lookup Function Wizard is displayed.

2. Setting up the lookup function:
    a. From the displayed lookups select the lookup you want to use (I have used the same lookup i created earlier)









 
b.  Click on Next 

The lookupValue function requires a source and target column.
The source column refers to your source value and the function returns the value in the corresponding target column.
If not found it will return the default value(if you define one)

Basic signature:
lookupValue(dvmlocation, srcColumn, srcvalue, targetColumn, defaultValue)

   c. Click on 'Select Source Column' and select the source column
   d. Repeat for Target Column
   e. Lookup definition will then look like below:








   f. Click on Next
   g. Enter a default value example: 'No Value Found' or leave blank
   h. Click on Next

Summary is like below:
















   i. Click on Done 
   j. You will see a Warning message because srcValue is not yet set
   k. Click on OK
   l. The expression is like below:

dvm:lookupValue('oramds:/apps/ICS/DVM/CountryNameLookUp.dvm','CountryCode',srcValue,'CountryName','')

  m. Remove the srcValue and map/enter the value you want to use.
  n. If hard coding, enter the value in quotes - example 'IN'

dvm:lookupValue('oramds:/apps/ICS/DVM/CountryNameLookUp.dvm','CountryCode','IN','CountryName','')

 3. Validate and Save.

When you will run your integration the lookup will fetch 'India'.


Helpful? Please Comment.

Happy Learning!!


No comments:

Post a Comment

OSB 12c : Dynamic Routing to Business/Proxy Service

Dynamic routing is a kind of  Content-based Routing pattern, which is used when the BusinessService/ProxyService path is required to be de...