# Test to see if value exists

**URL:** <https://community.postman.com/t/test-to-see-if-value-exists/26737>\
**Category:** Help Hub\
**Created:** [August 13, 2021, 8:55pm UTC](https://community.postman.com/t/test-to-see-if-value-exists/26737 "2021-08-13T20:55:03Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![cmnazario](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/cmnazario/32/10207_2.png) [@cmnazario](https://community.postman.com/u/cmnazario)\
**Post date:** [August 13, 2021, 9:36pm UTC](https://community.postman.com/t/test-to-see-if-value-exists/26737/2 "2021-08-13T21:36:30Z")

</div>

Hi, I think this topic can help you with what you need, but if you can’t let me know I’ll help 😉

> [@How to check if exists property in json?](https://community.postman.com/t/how-to-check-if-exists-property-in-json/6602/3):
>
> Hi @pablovok, just wanted to weigh in here about using [lodash which is inbuilt in Postman](https://learning.getpostman.com/docs/postman/scripts/postman_sandbox_api_reference/) and how you can easily get around this code piece. Using the [\_.get](https://lodash.com/docs/4.17.14#get) method from lodash, which allows safe extraction you’ll be able to avoid try...catch blocks. pm.test('Validate date', function () { var idDate = \_.get(jsonData, 'date[0].id'); if (idDate) { pm.expect(jsonData.date[0]).to.have.property('id'); } else { pm.expect(jsonData.date).to.have.property('id'); idDate = \_.get(jsonDat…

---

_[View the full topic](https://community.postman.com/t/test-to-see-if-value-exists/26737)._
