Here is the JSON format I am working with:
{
"records": [
{
"ID": "4",
"TYPE": "landscape",
"FIMAGE": "viewveni.jpg",
"COUNT": "4444"
}
],
"pagination": {
"count": 1,
"page": 1,
"limit": 10,
"totalpages": 1
}
}
I'm facing a challenge trying to retrieve the Second element
of the First element
, specifically records.TYPE
, without using the index name TYPE
.
I understand that records[0][1]
will not work and I've exhausted all my options.
Edit:
I realize I can access the data as records[0].TYPE, but I cannot use TYPE as plain text. However, if it's a variable then it's acceptable, for example: records[0].cat
where cat = 'TYPE'
.