# Getting "TypeError: Cannot read property 'titleId' of underfined"

**URL:** <https://community.postman.com/t/getting-typeerror-cannot-read-property-titleid-of-underfined/24498>\
**Category:** Help Hub\
**Created:** [June 4, 2021, 6:18am UTC](https://community.postman.com/t/getting-typeerror-cannot-read-property-titleid-of-underfined/24498 "2021-06-04T06:18:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![speplatform](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@speplatform](https://community.postman.com/u/speplatform)\
**Post date:** [June 4, 2021, 6:18am UTC](https://community.postman.com/t/getting-typeerror-cannot-read-property-titleid-of-underfined/24498/1 "2021-06-04T06:18:44Z")

</div>

Hi All, i receiving an error “TypeError: Cannot read property ‘titleId’ of underfined” when execute my testing. I’m take over this code from previous tester who already left, hence i not able to ask details from him. Kindly advice and many thanks.

Checked the test code (Collection), here is the step failed:

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/8/2/823b71bc82ff44ef0ec3e27b2383e63f463f2b15.png)  
Checked the environment variable, its already set TitleId there:  
 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/f/6/f68211adb4f01507aa0448b61235fd7363f707af.png)

Many Thanks.

---

<div class="post-metadata">

**Author:** ![neilstudd](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/neilstudd/32/8213_2.png) [@neilstudd](https://community.postman.com/u/neilstudd)\
**Post date:** [June 4, 2021, 1:07pm UTC](https://community.postman.com/t/getting-typeerror-cannot-read-property-titleid-of-underfined/24498/2 "2021-06-04T13:07:12Z")

</div>

Hi @speplatform,

The error isn’t relating to the environment variable; `Cannot read property 'titleId' of undefined` relates to the value **jsonData.title.titleId**. The suggestion from this error is that there is a problem with the response from your endpoint; it is indicating that it is unable to find the `title` element in the root of your response.

At the bottom of your first screenshot, I can see that the response has a **500 Internal Server Error** - this suggests that you have not received a valid response from your system.

---

<div class="post-metadata">

**Author:** ![speplatform](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@speplatform](https://community.postman.com/u/speplatform)\
**Post date:** [June 9, 2021, 2:30am UTC](https://community.postman.com/t/getting-typeerror-cannot-read-property-titleid-of-underfined/24498/3 "2021-06-09T02:30:17Z")

</div>

Hi, thank you for the response. Yeah, that ‘TitleId’ already solve, i solve it with provide proper authentication key.  
But having another similar issue, all the test case are running passed but at the end of testing, it still return “TypeError: Cannot read property ‘0’ of undefined”

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/5/0/500214a88430e7c82db479a7d2ba74018975f624.png)

Any idea why this happen? Checked the response, all return as expected, no way i can get the ‘0’ from.  
Kindly advice
