Deepti
2 years agoNew Contributor II
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...
- 2 years ago
HI Deepti - update the second Mapper expression to the following:
$items .map(x=> x.merge( { "additionalCoding" : { "workOrderNumber" : $project.projectId } , "contractDetails" : { "workOrderNumber" : $project.projectId } } ) )
So rather than an Object.extend(), we'll use Object.merge() to do a deep merge of the object, allowing us to also add the workOrderNumber into the existing contractDetails sub-element.
Hope this gets you closer to your goal!