# Get Nested Json

**URL:** <https://community.postman.com/t/get-nested-json/15476>\
**Category:** Help Hub\
**Tags:** tests\
**Created:** [September 1, 2020, 5:06am UTC](https://community.postman.com/t/get-nested-json/15476 "2020-09-01T05:06:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![onyxonyx1](https://avatars.discourse-cdn.com/v4/letter/o/eb9ed0/32.png) [@onyxonyx1](https://community.postman.com/u/onyxonyx1)\
**Post date:** [September 1, 2020, 5:06am UTC](https://community.postman.com/t/get-nested-json/15476/1 "2020-09-01T05:06:08Z")

</div>

HI,  
I want to retrieve only the `EmailAddress:"abhg.cotter@test.com"` listed in the response below.

Can you help me with my code below?

My code

```auto
 var jsonData = pm.response.json();
 pm.environment.set("Email", jsonData.Emails[1].EmailAddress);

[
  {
    "LIJ": "uuuuu480559",
    "Addresses": null,
    "Emails": [
      {
        "EmailID": 2546403,
        "EmailAddress": "testemail@test.com"
      }
    ]
  },
  {
    "LIJ": "mmmm9-42c324c71bb0",
     "Addresses": null,
    "Emails": [
      {
        "EmailID": 2546403,
        "IsDoNotEmail": true,
        "IsLogin": true,
        "EmailAddress": "testemail@test.com"
      },
      {
        "EmailID": 950651,
        "IsDoNotEmail": false,
        "EmailAddress": "abhg.cotter@test.com"
      }
    ]
  }
]

```

---

<div class="post-metadata">

**Author:** ![arlem](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/arlem/32/3078_2.png) [@arlem](https://community.postman.com/u/arlem)\
**Post date:** [September 1, 2020, 9:49am UTC](https://community.postman.com/t/get-nested-json/15476/2 "2020-09-01T09:49:06Z")

</div>

Hey @onyxonyx1, welcome to the community! 🚀

Here’s the code snippet you’ll need to use:

```
var jsonData = pm.response.json();
console.log("Email", jsonData.data[1].Emails[1].EmailAddress);

```

You were only missing the data object in your code. 🙂

If you have to do more of this JSON exploring I’d recommend having a look at this collection from @danny-dainton: [https://documenter.getpostman.com/view/1794236/SWE85HzS?version=latest](https://documenter.getpostman.com/view/1794236/SWE85HzS?version=latest)
