Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I am trying to parse below json, which has multple nested lists (input & output), how do I parse it ?
{
"data": {
"Days": [0, 1, 2, 3, 4, 5, 6],
"amount": [0, 0, 0, 234, 0, 0, 0]
}
}
Hi @Niranjan MANJESHWAR
To create an array element you'll need to "add an attribute named class and set its static value to array, and then add a sub-element named element set as a loop" (reference), then you map the source column to that element.
However, tWriteJSONField allows setting only one loop per tree. If you have access to Talend Data Mapper, you could use it to overcome this limitation.
Now if you're using TOS I'd suggest that, depending on your data volume, you create multiple arrays and store them in memory and then concatenate them to construct the full json structure.