Thursday, May 27, 2021

OIC - Fetch name and value params from a input string

Requirement:  

I have a input string called "report path" having multiple paramters appended with semicolon(;). So we have to fetch all name value parameters from the input string and save in a csv formated file for further use.

Example:

Input: abcreport;a=b;c=d

Output:

Csv file

Name= a Value=b

Name=c Value:d

Code steps:

Step1: Assign variable:

  • loopCount= 1.0
  • maxCount=returnCountOfString($reportPath,";")
  • loopCountString= 1.0

Note:oic-javascript-return-count-of-string

Step2: whileCount: loopCount <= maxCount

  • parameterName= returnParamter($reportPath, ";", "=,"Name", $loopCountString)
  • parameterValue = returnParamter($reportPath, ";", "=,"Value", $loopCountString)

Note: use this oic-javascript-find-name-and-value.

Step3: take a stage and Write file:

C1: parameterName

C2: parameterValue

Apend to existing file : yes

Step4: loop increment

If loopCountString = maxCount then

loopCount = loopCount + maxCount

Else

loopCountString = loopCountString +1


Screenshots:
















No comments:

Post a Comment

Featured Post

OIC - how can I use XSLT functions to remove leading zeros from numeric and alphanumeric fields?

To remove leading zeros from an numeric field in Oracle Integration Cloud (OIC) using XSLT, you can Use number() Function The number() funct...