cancel
Showing results for 
Search instead for 
Did you mean: 

JSON Splitter removing the data

krupalibshah
Contributor

I am using JSON splitter to split the input document into smaller documents. However the splitter will remove the element on which we are performing the split functionality. I need some work around to either retain it or to be able to add it back after the split.

See example below,

image

Splitting this at $…IDOC and I get below as output,

image

I need the output as,

image

The root element will be dynamic and need to capture that and should be available after the split.

Any help will be appreciated.

1 ACCEPTED SOLUTION

My problem was to be able to add the parent element dynamically, worked by using JSON generator,

{
  $root:
  {
        "IDOC" :$payload
    }
}

Got the value of “root” from expression library 🙂

Thanks for the help!

View solution in original post

6 REPLIES 6

Thanks for the help!
However I wanted to understand this a bit more. The above expression need to be put in expression lib right?

The lib will decide what the root element based on some mapping and then add corresponding parent. Let me know if my understanding is correct?

Possible for you to help me with sample pipeline?

My problem was to be able to add the parent element dynamically, worked by using JSON generator,

{
  $root:
  {
        "IDOC" :$payload
    }
}

Got the value of “root” from expression library 🙂

Thanks for the help!