Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
My requirement is to create json message as an output which will have nested array list. I tried to achieve it using twritejsonfield component but this supports only one loop element. Do we have some provision in talend which will allow us to set multiple elements but nested ones as loop elements through which I may achieve desired output:
Output Message Generated:
{"navDate":"2018-06-19T00:00:00",
"clients":
[
{"name":"SLB","fundGroups":{"name":"IBOR-DALY","funds":{"name":"I0AO","rules":{"systemName":"Valuation","startdate":"2018-06-20T10:00:00"}}}},
{"name":"SLB","fundGroups":{"name":"IBOR-DALY","funds":{"name":"I247","rules":{"systemName":"Valuation","startdate":"2018-06-19T10:00:00"}}}},
{"name":"SLB","fundGroups":{"name":"IBOR-DALY","funds":{"name":"I520","rules":{"systemName":"Valuation","startdate":"2018-06-20T10:00:00"}}}}
]
}
Desired Output Message:
{"navDate":"2018-06-19T00:00:00",
"clients":
[ {"name":"SLB","fundGroups":[{"name":"IBOR-DALY","funds":[{"name":"I0AO","rules":[{"systemName":"Valuation","startdate":"2018-06-20T10:00:00"}]},{"name":"I247","rules":[{"systemName":"Valuation","startdate":"2018-06-19T10:00:00"}]},{"name":"I520","rules":[{"systemName":"Valuation","startdate":"2018-06-20T10:00:00"}]}]}]}
]
}
Not really sure how to achieve what you want ...
I use tXMLMap, create a column of Document type and aggregate and loop on the lowest level, like this structure:
-- out
---- navData
---- clients
--------- name <---- aggregate
--------- fundgroups
----------------- name
----------------- funds
-------------------- name <--- loop level
-------------------- rules
------------------------- systemName
------------------------- startdate