I am facing an issue with extracting value from Json response body.
I have a JSON response
{
"abc": [
{ "xyz": {
"date": "2019-06-03T11:06:53.000Z"
},
}
]
}
and I want to get the value of date
and assign it to an environment variable.
I have created a script for this as below:
var jsonData = pm.response.json();
postman.setEnvironmentVariable("lastModifiedDate",jsonData.abc.xyz.date.value);
this throws error
There was an error in evaluating the test script: TypeError: Cannot read property ‘date’ of undefined
Can anyone help me with this?