I have this below object structure which is having 3 records as a sample now. But We will be having more than 20 records.
{
"data": [{
"datatype": "AccessoryProduct",
"values": {
"identifier": "access8770009prd",
"shortdescription": "<p>Hybrid Dual Injection Cover and a Tempered Glass.<\/p>",
"displayname": "Protection Essentials Bundle - Samsung Galaxy S9 (Clear) 822445132623"
}
},
{
"datatype": "AccessoryProduct",
"values": {
"identifier": "access8530068prd",
"shortdescription": "String.class",
"displayname": "JBL UA Flex Headphones (Gray) - 050036342735"
}
}, {
"datatype": "AccessoryProduct",
"values": {
"identifier": "access8630012prd",
"shortdescription": "<p>This slim case has everything you want - style and protection.<\/p>",
"displayname": "Otterbox Symmetry Series Case - Samsung Galaxy S9 (Clear) - 660543444121"
}
}
]
}
From the above object, I need to get this below array.
identifierList = [ 'access8770009prd', 'access8530068prd', 'access8630012prd' ]
as a single dimensional array. Can anyone please provide an efficient approach.
identifierListin your desired output is not an array but an object instead. I take it this should've been['access8770009prd', 'access8530068prd', 'access8630012prd']?