An output json field may be an array, such as: "customerCode": ["CustomerCode1"],
Current mapper does not support this output automatically. This is a guideline for work around in creating the desired output.
Instructions
There are 2 ways to do the work around:
Option1: def varArray0 = """["${var0}"]"""
var0 is the input value, and varArray0 is the output value.
We are “hardcoding” the brackets and quotes around the input value.
This is acceptable if there is only 1 source/input value
Option2:
def varArray1 = []
var1 = '"'+var1+'"'
varArray1.add(var1.toString())var1 is the input value, and varArray1 is the output value
We define varArray1 as an array/list
We are “hardcoding” the quotes around the input value.
This is useful if the input is a looping source field.
0 Comments