I'm facing issues in retrieving the JSON data.
Here am getting the JSON with dynamic keys. And I need to access that dynamic key's values. The dynamic key is coming from URL and am fetching that key's data from DB.
Here is my sample data.
let roleData = [
{
"assetCategory": {
"canCreate": false,
"canView": false,
"canUpdate": false,
"canDelete": false,
"isMenu": false,
"parent": "settings"
}
}
]
In the above JSON, I've got assetCategory object. But this value is completely dynamic. I might get other values too in the place of assetCategory. So without knowing this key, it's getting difficult for me to access the data.
Is there any way to access this dynamic object?