Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Rewriting of an array from one local JSON file to another problem.

Hi guys,
I have a problem with Talend with creating a JSON file. I'm trying to extract the array from locally stored JSON file and rewrite it to another local JSON file excluding one of the field ( the most important is the rewriting the complete array in the same structure). I tried it with tExtractJSONfields but the result was like this. What I'm getting is an object in the field with all the data at the same time or separated fields without array structure.
I've tried all the tutorials but it's simply not working.
Is anyone knowing how to do it? And able to post a small guidance how to configure the components.



Orginal JSON file:

{
"product":[
{
"eventId": "222-ewq-222-erwf",
"partName": "aaaaaaaa",
"attributeGroup":[
{
"groupId": "GroupNaterId:123456768",
"name": null
},
{
"groupId": "GroupNaterId:123456768",
"name": "noName"
}

]
},
{
"eventId": "111-ewq-111-erwf",
"partName": "bbbbbbb",
"attributeGroup":[
{
"groupId": "GroupNaterId:1245543",
"name": null
},
{
"groupId": "GroupNaterId:1247777",
"name": "productName1"
},
{
"groupId": "GroupNaterId:12333333",
"name": "productName2"
}
]
}
]
}



Regards: Peter

0683p000009MFzo.jpg

Labels (2)
1 Reply
vapukov
Master II
Master II

as variant, something like this:
in Your case You can test 2 lines:

$.product[1].eventId
$.product[1].attributeGroup[_star_]

product[1] - first event, and etc
attributeGroup - will be transferred as single element with all dependencies, if need parse them also - need edit, like

$.product[1].attributeGroup[1].groupid
$.product[1].attributeGroup[1].name



after this single record easy parsed to flat structure or other JSON file, just loop over all
it small example from HubSpot project, in Your case result[XXX] need change to product[XXX]

0683p000009MFsp.png   0683p000009MFx5.png