Forum Discussion

neelamanikandan's avatar
neelamanikandan
New Contributor II
2 years ago
Solved

Splitting Json with array[0]

I have a Json data, that contains a field that could be an array as per Source definition. Json given below It is not always mandatory that the FeeReductionDetail will always be an array with multip...
  • Aleksandar_A's avatar
    2 years ago

    Hello neelamanikandan,

    You can use the sl.ensureArray() function to ensure that the FeeReductionDetail field will always be an array.

    Just place a Mapper before the Splitter with the following settings:

    Expression: sl.ensureArray($FeeReduction.FeeReductionDetail)

    Target Path: $FeeReduction.FeeReductionDetail

    With Pass through turned on.

    Let me know if this helps you.

    Regards,

    Aleksandar.