Customer Portal

JSON Nested Elements

Comments 1

  • Avatar
    Vladimir Barton
    0
    Comment actions Permalink
    Hello Mybludrunsorange,
    please find the attached solution based on your example. The main idea is to extract the data to 2 output ports by using JSONExtract and outputting them with JSONWriter by using the parent key concept. Below is a more detailed explanation of the key setup:

    • I used the equivalent XML Schema (.XSD file) that Clover extracted automatically

    • I mapped the ‘tickets’ and the ‘custom_fields’ elements to flow into separate ports with different metadata while retaining the ‘ticketID’ field in both of them as the key that preserves the mutual link between the 2 ports

    • In JSONWriter, I added bindings to the respective elements (ticketIDmetadata on Port 0 to the ‘tickets’ element and customFieldsMetadata on Port 1 to the ‘custom_fields’ element) and mapped the fields accordingly

    • On the ‘custom_fields’ binding, I defined the key/parent key relation in order to recreate the mutual link between the 2 data flows

    • In the Advanced properties of JSONWriter, I have also set the sorting input to TRUE and defined sort keys (‘ticketID’ on both ports)

    • From your example, I assumed that you need to omit also some of the custom fields based on their id. If my assumption is correct, this can be achieved by a Filter component as demonstrated in the attached project

    Regards,

Please sign in to leave a comment.