How to convert an XML with repeated elements to a JSON array

When you enter an xml which has more than one repeated connectors, our JSON converter converts the repeated connectors into a JSON array with different JSON objects within the array. Shown below is a sample xml response payload we received from a vendor:

In the above xml, <GLENTRY> is repeated more than once and the JSON conversion is as shown below. The JSON converter converts the xml into a JSON array with multiple objects.

However, if the xml contains only one repeated connector, the JSON converter converts the xml into an object instead of an array.

In order to avoid this from happening, you can now configure a parameter by adding the comma-separated JSON path of the repeated connectors in the xml and vendor's information field as xmlResponseArrayField as shown below.

Related Links