# Validate json values and pass the test if at least one of the Json values matches the specified condition

**URL:** <https://community.postman.com/t/validate-json-values-and-pass-the-test-if-at-least-one-of-the-json-values-matches-the-specified-condition/12613>\
**Category:** Help Hub\
**Tags:** json\
**Created:** [May 13, 2020, 1:52pm UTC](https://community.postman.com/t/validate-json-values-and-pass-the-test-if-at-least-one-of-the-json-values-matches-the-specified-condition/12613 "2020-05-13T13:52:01Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![aravaws](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@aravaws](https://community.postman.com/u/aravaws)\
**Post date:** [July 7, 2020, 7:22am UTC](https://community.postman.com/t/validate-json-values-and-pass-the-test-if-at-least-one-of-the-json-values-matches-the-specified-condition/12613/2 "2020-07-07T07:22:59Z")

</div>

Finally I solved the issue. Please check the solution on this link

> [@Validating Json array using java script](https://community.postman.com/t/validating-json-array-using-java-script/13721/4):
>
> You could use something like this to loop through and filter the objects that contain items greater than 300. It will create an array that you can assert against the length of to see if it’s above 1. I’ve added in a custom error string that shows you why it failed. pm.test('Is atleast one of the batch in future \>=300', () =\> { let result = pm.response.json().filter(arr =\> arr.items \>= 300) pm.expect(result.length).to.be.above(1, `Objects matching condition ${result.length}`) }) This w…

---

_[View the full topic](https://community.postman.com/t/validate-json-values-and-pass-the-test-if-at-least-one-of-the-json-values-matches-the-specified-condition/12613)._
