Forum Discussion

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

Retrieve a list within another array list

Hi there, I have one input json like as follows: { "isValid": true, "logId": "9IE9BkOwxvrCwn_Ot7p4o-1699858392", "contractId": 1, "erpVendorId": "VID123", "erpVendorName": null...
  • Pretpark's avatar
    10 months ago

    I have found the solution myself.
    This is the way i did it:

    The first XML formatter is the one with 'wrong' output, so i used the binary to document snap set to 'NONE' so i can map it in the mapper snap.
    In the mapper snap i did the following:
    '<?xml version="1.0" encoding="UTF-8"?>' + $content.substring($content.search("<Data><YOURXMLKEY>") +6).replace("</Data></YOURXMLKEY>", "").replace("</ADDRESSES><ADDRESSES>", "")

    This resulted in the XML format i wanted, but it was still in 'JSON' format. So i used a CSV formatter (format to string snap in image) from which i unchecked 'write CSV header', removed the quote character, set the escape character to '\' and set the delimter to something which i know will never be in the message, in my case: '↨'.

    If anyone has a better/cleaner solution, i would love to know.

    -Tim