Hi,
I need to convert this datatable (3 or more levels) into grouped json (id can be anything as long as there are unique, text goes into title, and the children under “subs”). Is there an easy way to do it?
[
{
"id": 1,
"title": "Four Wheels",
"subs": [
{
"id": 10,
"title": "Car",
"subs": [
{
"id": 100,
"title": "Sport"
},
{
"id": 101,
"title": "SUV"
}
]
},
{
"id": 11,
"title": "Truck"
},
{
"id": 12,
"title": "Transporter"
}
]
},
{
"id": 2,
"title": "Two Wheels",
"subs": [
{
"id": 20,
"title": "Cycle"
},
{
"id": 21,
"title": "Motorbike",
"subs": [
{
"id": 210,
"title": "Racing"
},
{
"id": 211,
"title": "Chopper"
}
]
}
]
},
{
"id": 2,
"title": "Van"
},
{
"id": 3,
"title": "Bus"
}
]