Forum Discussion
bojanvelevski
5 years agoValued Contributor
Hello @alex.panganiban.guild,
You cannot access the ‘name’ field directly because as you said, you have a mixed data type array. You first need to access the object, and than the field that you need from that object. So , if you need to get the index number of an object, you can use this function:
$arrayField.findIndex(x=>typeof x == “object”)
And if you want the index number of the ‘name’ path of that object, you can use the following function:
$arrayField[$arrayField.findIndex(x=>typeof x == “object”)].keys().findIndex(x=>x == ‘name’)
Hope you’ll find this helpful,
Regards,
Bojan
Related Content
- 8 years ago