I have a table with a tree of products. Category, Group and Subgroup.
When I export json to excel, the file exits without hierarchy: As in this example:
[
{
"id_cat": 4,
"desc cat": "Acessorios para Veiculos",
"id_gr": 1,
"desc gr": "Acessorios Nautica",
"id_sub": 15,
"desc sub": "Bombas"
},
{
"id_cat": 4,
"desc cat": "Acessorios para Veiculos",
"id_gr": 1,
"desc gr": "Acessorios Nautica",
"id_sub": 16,
"desc sub": "Cabos"
},
{
"id_cat": 4,
"desc cat": "Acessorios para Veiculos",
"id_gr": 1,
"desc gr": "Acessorios Nautica",
"id_sub": 17,
"desc sub": "Helices"
},
I need to generate the file this way:
[
{
"category": {
"id": 4,
"name": "Acessorios para Veiculos",
"group": [
{
"id": 1,
"name": "Acessorios Nautica",
"subgroup": [
{
"id": 15,
"name": "Bombas"
},
{
"id": 16,
"name": "Cabos"
},
{
"id": 17,
"name": "Helices"
}
]
},
{
"id": 2,
"name": "Acessorios de Carros",
"subgroup": [
{
"id": 26,
"name": "Exterior"
},
{
"id": 27,
"name": "Interior"
}
]
}
]
}
}
]
Do you want to do this with excel? How do I create a file in this format through my table?