Get Nested Json

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

 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"
      }
    ]
  }
]

Hey @onyxonyx1, welcome to the community! :rocket:

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. :slightly_smiling_face:

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