I want to generate a datatable with name, position, phone and email from the following json. But I don't now how to access the name and the nested value. Changing the json is not possible.
JSON:
{
"key1" : "somevalue",
"key2" : "somevalue2",
"contacts" : {
"John Doe" : {
"position" : "CEO",
"phone" : "1234-5678-0",
"email" : "[email protected]"
},
"Elvis Presley" : {
"position" : "Singer",
"phone" : "0234-5678-0",
"email" : "[email protected]"
},
"Albert Einstein" : {
"position" : "Thinker",
"phone" : "0000-8888-0",
"email" : "[email protected]"
}
}
RESULT:
+-----------------+----------+-------------+---------------------+
| NAME | POSITION | PHONE | EMAIL |
+-----------------+----------+-------------+---------------------+
| John Doe | CEO | 1234-5678-0 | [email protected] |
+-----------------+----------+-------------+---------------------+
| Elvis Presley | Singer | 0234-5678-0 | [email protected] |
+-----------------+----------+-------------+---------------------+
| Albert Einstein | Thinker | 0000-8888-0 | [email protected] |
+-----------------+----------+-------------+---------------------+