Search code examples
postmanweb-api-testingpostman-testcase

POSTMAN: TypeError: Cannot read properties of undefined (reading 'data')


I am working on chaining of the API requests via POSTMAN. I was trying to get a value of a variable from response body to use it into other API requests under my collection but I am getting an error "TypeError: Cannot read properties of undefined (reading 'data')" while running attached API request. Could you please guide on why this is not working? I am using POSTMAN version v9.24.1. Here is the response body enter image description here

enter image description here


Solution

  • Why are you having that x when setting value?

    This does what you want: let value = bodyData.data[2].first_name;