Sunday, December 1, 2024

#1047 - OIC Integration Basics Lab 13 OIC Lookups

 

Lookups are domain value maps, which make it easy for us to map values between different applications. These values could be essentially for the same thing, e.g. a country code. In app1, the country of Ireland is referred to as IE (alpha 2 code), while in app2, it is referred to as IRL (alpha 3 code).


You can also change the column titles to reflect the target app - 

Now to using this in an integration, here's one, where I create a new customer in Netsuite - 

This starts the lookup wizard - 

First step is to select the source column, in my case, App1 - 

Then the Target - 

I could add a default value, but, in this case, I leave it empty - 


Note the srcValuePlaceholder - this I need to replace with the country field from the request payload -




I map the other fields accordingly - 

I activate and run the integration -

So "IE" is not the right code for Netsuite, so I look at the Netsuite docs - 

So I change the lookup accordingly - 

I run the integration again, and get a new error - 
Netsuite requires a subsidiary id, i.e. under which subsidiary do I want to create the customer. 

The subsidiary value, in my case 1, is also a good candidate for a lookup -

I use this in the mapper - 


srcValuePlaceHolder needs to be replaced by 'subsidiaryID'.

I re-run the integration - 

Note the Netsuite internal id for the newly created customer.

Finally, lookup support in the OIC3 Factory api

Here we have CRUD support for lookups, as well as the ability to import.

Import is very useful when the lookup values are coming from an external source e.g. my products csv file - 

Line 1 A - DVM mandatory
Line 1 B - Lookup name
Line 1 C - Lookup description
Line 1 D - keyword

Line 2 - Lookup columns
Lines 3 to 6 - Lookup values

Note the 204 response.

This Lookup has been added to OIC, but not to a specific project. To do that, I need to invoke - /ic/api/integration/v1/projects/{projectId}/lookups/archive



  













 

 



























No comments: