I have a Excel-file with the following content:
group1group2group3nameinfoGeneralNationPhilinfo1GeneralNation
Kareninfo2GeneralMunicipality
Billinfo3GeneralMunicipality
Paulinfo4SpecificProvince
Patrickinfo5SpecificProvince
Maikelinfo6SpecificProvinceGovernanceMikeinfo7SpecificProvinceGovernanceLukeinfo8SpecificDistrict
Mariainfo9SpecificDistrict
Davidinfo10
The attributes can be adjusted it is a Excel-file; I create the file myself.
I would like to automatically create a nested JSON file.
This should look like this:
"name": "Overview",
"children": [{
"name": "General",
"children": [
{ "name": "Nation",
"children": [
{"name": "Phil", "info": "info1"},
{"name": "Karen", "info": "info2"}
]
},
{ "name": "Municipality",
"children": [
{"name": "Bill", "info": "info3"},
{"name": "Paul", "info": "info4"}
]
}
]
},
{
"name": "Specific",
"children": [
{ "name": "Province",
"children": [
{"name": "Patrick", "info": "info5"},
{"name": "Maikel", "info": "info6"},
{"name": "Governance",
"children": [
{"name": "Mike", "info": "info7"},
{"name": "Luke", "info": "info8"}
]
}
]
},
{ "name": "District",
"children": [
{"name": "Maria", "info": "info9"},
{"name": "David", "info": "info10"}
]
}
]
}
]
I tried the JSONTemplater transformer, but I can't figure out how this works.
I am not sure where to put the template, either in the root or in the sub.
Hope someone can help me with this!
Kind regards,
Stefan