Get Nested Json

HI,
I want to retrieve only the EmailAddress:"[email protected]" 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": "[email protected]"
      }
    ]
  },
  {
    "LIJ": "mmmm9-42c324c71bb0",
     "Addresses": null,
    "Emails": [
      {
        "EmailID": 2546403,
        "IsDoNotEmail": true,
        "IsLogin": true,
        "EmailAddress": "[email protected]"
      },
      {
        "EmailID": 950651,
        "IsDoNotEmail": false,
        "EmailAddress": "[email protected]"
      }
    ]
  }
]

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 @danny-dainton: https://documenter.getpostman.com/view/1794236/SWE85HzS?version=latest