# GetObjectField for nested JSON file

**URL:** <https://forums.unrealengine.com/t/getobjectfield-for-nested-json-file/442298>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [January 29, 2019, 11:06am UTC](https://forums.unrealengine.com/t/getobjectfield-for-nested-json-file/442298 "2019-01-29T11:06:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_41e411801](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41e411801](https://forums.unrealengine.com/u/anonymous_user_41e411801)\
**Post date:** [January 29, 2019, 11:06am UTC](https://forums.unrealengine.com/t/getobjectfield-for-nested-json-file/442298/1 "2019-01-29T11:06:04Z")

</div>

This a sample JSON File:

```
{"people":
[{
  "id": 1,
  "first_name": "",
  "last_name": "",
  "email": "",
  "gender": "Female",
  "ip_address": ""
}, {
  "id": 2,
  "first_name": "",
  "last_name": "",
  "email": "",
  "gender": "Male",
  "ip_address": ""
}, {
  "id": 3,
  "first_name": "",
  "last_name": "",
  "email": "",
  "gender": "Female",
  "ip_address": ""
}, {
  "id": 4,
  "first_name": "",
  "last_name": "",
  "email": "",
  "gender": "Male",
  "ip_address": ""
}]}

```

How would you get the value of the field “first\_name”

```
TSharedPtr<FJsonObject> FirstName= JsonObject->GetObjectField("people.first_name");

```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_df6ed9f5](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_df6ed9f5](https://forums.unrealengine.com/u/anonymous_user_df6ed9f5)\
**Post date:** [January 29, 2019, 8:46pm UTC](https://forums.unrealengine.com/t/getobjectfield-for-nested-json-file/442298/2 "2019-01-29T20:46:20Z")

</div>

Don’t know if you got it sorted out, but I found a pretty nasty function that works for nested objects and, also, for arrays altogether. And it gives you a USTRUCT, so you don’t have to use the functions that get values by Keys (I don’t like them since they’re very error prone). Instead, you’ll have type safety!
