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

OIC - Restrictions on Using Stage File Action Operations with the File/Attachment Features of the Connectivity Agent

Restrictions on Using Stage File Action Operations with the File/Attachment Features of the Connectivity Agent When configuring the stage fi...