Unable to show json data in the table with repeated Root node value multiple times as one column and Children elements as other columns single values

0

Hi All,

 

I was trying to create a table from JSON to show the root element multiple times and the properties of child to be repeated but I am getting the root only once and delimited multiple values associated with them. Please guide me to find the way out to achieve my final output as desired.

Please help-

I have a JSON something like

 

"companyDesignationTree": {
        "id": "12754540",
        "name": "The Main Boss",
        "children": [{
            "id": "714630",
            "name": "Employee1",
            "children": [{
                "id": "684451",
                "name": "Employee2",
                "designation": "Sales Executive"
            },
            {
                "id": "620450",
                "name": "Employee3",
                "designation": "Sales Executive"
            },
            {
                "id": "739716",
                "name": "Employee4",
                "designation": "Sales Manager"
            },
            {
                "id": "566065",
                "name": "Employee5",
                "designation": "Area Sales Manager"
            },
            {
                "id": "564912",
                "name": "Employee6",
                "designation": "Sales Executive"
            }],
            "designation": "Sales Director"
        },
        {
            "id": "197596",
            "name": "Employee7",
            "children": [{
                "id": "1323310",
                "name": "Employee8",
                "designation": "HR Manager"
            },
            {
                "id": "565013",
                "name": "Employee9",
                "designation": "HR Manager"
            },
            {
                "id": "754541",
                "name": "Employee10",
                "designation": "HR Executive"
            },
            {
                "id": "620056",
                "name": "Employee11",
                "designation": "HR Executive"
            },
            {
                "id": "1240541",
                "name": "Employee12",
                "designation": "Intern"
            }]
        }]
    }
 

And i was trying to get the output something like -

Employee Reportee Designation
Employee1 Employee2 Sales Executive
Employee1 Employee3 Sales Executive
Employee1 Employee4 Sales Manager
Employee1 Employee5 Area Sales Manager
Employee1 Employee6 Sales Executive
Employee7 Employee8 HR Manager
Employee7 Employee9 HR Manager
Employee7 Employee10 HR Executive
Employee7 Employee11 HR Executive
Employee7 Employee12 Intern

Thanks

bhuwanesh2000's picture
Joined: Sep 23 2016 - 6:24am
Last seen: 2 years 9 months ago

0 Answers:

No answers yet
Feedback