AnsweredAssumed Answered

Split Json by Unique element value

Question asked by elison.w.wang075238 on May 29, 2018
Latest reply on May 31, 2018 by elison.w.wang075238

I have a scenario of split json profile into multiple json profiles. And it should split by unique poheaderId. I tried to search and no good solutions yet. My workaround is to map Json > flat file, and use split data process shape by using linked element -  poHeader id. It will generate a 'consolidated' PO details in multiple flat files

 

I'd like to check if we have a mature practice to map from Json to Json and by element id and then unique value.

 

 

---data as below:

Source Json profile is something like this:

 

{

"result": [{
"lastUpdateDate": "2018-05-17T16:44:24.000+0800",
"itemCode": "1234567",
"publishDate": "2011-09-28T19:25:18.000+0800",
"poHeaderId": 110022,

"poLineId": 8871,

},

{
"lastUpdateDate": "2018-05-17T16:44:24.000+0800",
"itemCode": "1234567",
"publishDate": "2011-09-28T19:25:18.000+0800",
"poHeaderId": 110022,

"poLineId": 8872,

},

{
"lastUpdateDate": "2018-05-17T16:44:24.000+0800",
"itemCode": "1234567",
"publishDate": "2011-09-28T19:25:18.000+0800",
"poHeaderId": 221133,

"poLineId": 1827,

}]

}

 

-------------------------------------------------

The expected Json should as follows:

1st Json - 

{

"result": [{
"lastUpdateDate": "2018-05-17T16:44:24.000+0800",
"itemCode": "1234567",
"publishDate": "2011-09-28T19:25:18.000+0800",
"poHeaderId": 110022,

"poLineId": 8871,

},

{
"lastUpdateDate": "2018-05-17T16:44:24.000+0800",
"itemCode": "1234567",
"publishDate": "2011-09-28T19:25:18.000+0800",
"poHeaderId": 110022,

"poLineId": 8872,

}]

}

 

2nd Json - 

{

"result": [{
"lastUpdateDate": "2018-05-17T16:44:24.000+0800",
"itemCode": "1234567",
"publishDate": "2011-09-28T19:25:18.000+0800",
"poHeaderId": 221133,

"poLineId": 1827,

}]

}

Outcomes