I have just begun to use Nifi to read in JSON array and trying to save the output into a MySQL table.
The main issue is that the "extraDetails" is an array and I would need the id to be inserted with each extraDetails element.
This is a sample of the JSON:
[
{
"id": "2fa84997-b15f-4859-b315-8125ba79555f",
"extraDetails": [
{
"from": "2023-10-06T03:05",
"to": "2026-10-07T03:05:44",
"additionalDetails": "{\"serviceId\":13,\"serviceTierIds\":[73,74],\"serviceEntitlementIds\":[]}"
},
{
"from": "2023-10-06T03:06",
"to": "2026-10-07T03:06:20",
"additionalDetails": "{\"serviceId\":14,\"serviceTierIds\":[75,76,77,78],\"serviceEntitlementIds\":[]}"
},
{
"from": "2023-10-06T03:06",
"to": "2026-10-07T03:06:47",
"additionalDetails": "{\"serviceId\":3,\"serviceTierIds\":[67,68],\"serviceEntitlementIds\":[]}"
}
]
},
{
"id": "cade90bd-62a3-48ce-87a0-0452e3efb3fc",
"extraDetails": [
{
"from": "2023-10-27T11:00",
"to": "2026-10-27T11:00:45",
"additionalDetails": "{\"serviceId\":1,\"serviceTierIds\":[59,58,57,56,55,60,61],\"serviceEntitlementIds\":[]}"
}
]
}
]
My table columns are: id | from | to | additionalDetails.
I have tried SplitJson but it seems to remove the "id" attribute value.

I am currently reading up on JoltTransformJSON to see if it can split the nested JSON while still providing the "id".
Please let me know if this is the right direction?

