Member since
03-08-2023
3
Posts
0
Kudos Received
0
Solutions
03-11-2023
11:00 AM
Hi Samsal - that's perfect. Many thanks , Rob 👍
... View more
03-09-2023
12:13 AM
Thanks Diana I'll look out for their reply.
... View more
03-08-2023
02:44 PM
Hello , can anyone help with a spec to transform this JSON input to the desired output . JSON INPUT ========== { "saleStrategy": { "strategy": "strategy1", "code": "code1" }, "saleStrategyCollection": [ { "id": "2", "saleStrategy": { "strategy": "strategy2", "code": "code2" } }, { "id": "3", "saleStrategy": { "strategy": "strategy3", "code": "code3" } } ] } == desired output json == { "saleStrategies" : [ { "strategy" : "strategy1", "code" : "code1" }, { "strategy" : "strategy2", "code" : "code2" }, { "strategy" : "strategy3", "code" : "code3" } ] } == current spec === // this currently only transforms the initial single saleStrategy object to an array called salesStrategies. Desired output above shows that If there is a saleStrategy array also present in the input JSON , then the spec needs to add the saleStrategy objects within that array to the salesStrategies output array as well . NOTE the transform must not include "id" in the output. [ { "operation": "shift", "spec": { "saleStrategy": { "strategy": "saleStrategies[0].strategy", "code": "saleStrategies[0].code" } } } ] Any suggestions would be greatly appreciated. Thanks in advance, Rob.
... View more
Labels:
- Labels:
-
Apache NiFi