I have a scenario, where I need to layout data in both Horizontally and Vertically.
Is this even possible? I can't even figure out how to to a vertical loop.
(Note Real data is very dynamic number of "Departments" and Number of "Employees" per department is very variable.
The result I need is:
Sample JSON that matches the data above.
{
"departments": [
{
"Name": "Sales",
"employees": {
"employee": [
{
"id": "1",
"firstName": "Tom",
"salary": 80000
},
{
"id": "2",
"firstName": "Maria",
"salary": 95000
},
{
"id": "3",
"firstName": "Robert",
"salary": 70000
}
]
}
},
{
"Name": "Accounting",
"employees": {
"employee": [
{
"id": "10",
"firstName": "Jim",
"salary": 65000
},
{
"id": "22",
"firstName": "Susan",
"salary": 100000
}
]
}
}
]
}