Monday, August 30, 2021

OIC - Update lookup from a CSV file

UseCase: Here, we will feed a lookup name as input and then based on the lookup name we will fetch the Lookup csv file from a location using FTP protocol and then call lookup rest api to update the the respective lookup.


Rest API details to update lookup:

API : /ic/api/integration/v1/lookups/{name}

Verb : PUT

Request Json payload:

{"columns":["rightnow","soap"],"rows":[{"rowData":["RN1","SOAP1"]},{"rowData":["RN2","SOAP2"]}],"name":"myLookup"}


Prerequisites:

  • You should have a FTP connection to read the csv.
  • You should have a ICS rest connection.

Implementation steps:

Step1: We will feed lookup name.

URI: /update/{lookupName}



Step2: Read the file from a location using FTP and parse with a csv sample file schema.


In the map, concat lookup name with .csv
concat(lookupName,".csv")

Step3: Rest API URL configure to update Lookup.


Step4: Provide the sample Json request payload.


Step5: Map the lookup name and csv response to Lookup update rest request.

►Here haedcoded, "Country_Code" and "Country_Name" to each Columns.
►For each lookup row map to rows and map the code and name fields to each rowData.
►Map template lookup name to name.
►Map input template lookup name to rest request template parameter name.




The Integration flow looks below:


Before lookup update:


After update:




No comments:

Post a Comment

Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...