# \#exists

**URL:** https://community.postman.com/tag/exists/322.md

[Latest](https://community.postman.com/latest.md) · [Categories](https://community.postman.com/categories.md) · [Tags](https://community.postman.com/tags.md)

---

## [Use IF statement to check if data field in nested array exists, and if it exists set the value to a variable](https://community.postman.com/t/use-if-statement-to-check-if-data-field-in-nested-array-exists-and-if-it-exists-set-the-value-to-a-variable/49227)

<div class="topic-metadata">

**Author:** [@chris.ohare](https://community.postman.com/u/chris.ohare)\
**Replies:** 2\
**Last updated:** [July 7, 2023, 3:46am UTC](https://community.postman.com/t/use-if-statement-to-check-if-data-field-in-nested-array-exists-and-if-it-exists-set-the-value-to-a-variable/49227 "2023-07-07T03:46:35Z")

</div>

My question: I want to capture data from three objects in a JSON response, however, two of the objects are always in the response, and one is not always there (by design). Additionally, the first two objects that are alw…

---

## [How to check if exists property in json?](https://community.postman.com/t/how-to-check-if-exists-property-in-json/6602)

<div class="topic-metadata">

**Author:** [@pablovok](https://community.postman.com/u/pablovok)\
**Replies:** 2\
**Last updated:** [July 18, 2019, 8:20am UTC](https://community.postman.com/t/how-to-check-if-exists-property-in-json/6602 "2019-07-18T08:20:54Z")

</div>

Hello, I want to validate a piece of the json’s response, but the data varies its position … I thought something like that … but it does not work for me. Example: pm.test(‘Validate date’, function() { var idDate; if…
