cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Do JSON mapping in a single mapper

Yashb81
New Contributor

Hi Everyone,

This is my sample JSON data.

Yashb81_0-1711524693483.png

I want to map this data in a single mapper in order to get the result set below.

Yashb81_1-1711524785575.png

Currently I am using too many snaps to do the same. I want to reduce my number of snaps and get it done in 1 mapper.

1 ACCEPTED SOLUTION

tlikarish
Employee
Employee

Here are two ways you could accomplish this.

The first is to copy the data into two streams, split, and then union it back up together. See the attached json-splitter-example for reference.

The second is to use a Mapper to concat the two arrays together and then use a JsonSplitter afterwards to split on the new array so you have a document for each of the elements of the new array. See single-mapper-example as reference.

Hope this is helpful.

 

View solution in original post

2 REPLIES 2

tlikarish
Employee
Employee

Here are two ways you could accomplish this.

The first is to copy the data into two streams, split, and then union it back up together. See the attached json-splitter-example for reference.

The second is to use a Mapper to concat the two arrays together and then use a JsonSplitter afterwards to split on the new array so you have a document for each of the elements of the new array. See single-mapper-example as reference.

Hope this is helpful.

 

Hi @tlikarish,

Thank you for the solution. It works ๐Ÿ™‚