# How to ignore response when it fail

**URL:** <https://community.postman.com/t/how-to-ignore-response-when-it-fail/19346>\
**Category:** Help Hub\
**Tags:** collections\
**Created:** [January 20, 2021, 2:40pm UTC](https://community.postman.com/t/how-to-ignore-response-when-it-fail/19346 "2021-01-20T14:40:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![technical-technologi](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/technical-technologi/32/7024_2.png) [@technical-technologi](https://community.postman.com/u/technical-technologi)\
**Post date:** [January 20, 2021, 2:40pm UTC](https://community.postman.com/t/how-to-ignore-response-when-it-fail/19346/1 "2021-01-20T14:40:20Z")

</div>

Hi . Can I know how to make postman ignore the response when it fail but let it run as usual if it is pass? I hope you guys can help me

---

<div class="post-metadata">

**Author:** ![taehoshino](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/taehoshino/32/6608_2.png) [@taehoshino](https://community.postman.com/u/taehoshino)\
**Post date:** [January 21, 2021, 1:40am UTC](https://community.postman.com/t/how-to-ignore-response-when-it-fail/19346/2 "2021-01-21T01:40:04Z")

</div>

Hi @technical-technologi! Welcome to the community 👋

As I understand it, you want to run chained requests in a collection such that:

- It terminates if one request returns an error code (e.g 40X and 50X).
- It continues to the next request if the response status code is 200.

If this is what you want to achieve, you can include a script similar to the following example in Tests tab:

```
if (pm.response.code === 200) {
    postman.setNextRequest('Your Next Request')
} else {
    postman.setNextRequest(null)
}

```

Hope this helps! Please let me know if this is not exactly what you are after 🙃

---

<div class="post-metadata">

**Author:** ![bpricilla](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/bpricilla/32/6511_2.png) [@bpricilla](https://community.postman.com/u/bpricilla)\
**Post date:** [January 21, 2021, 1:40am UTC](https://community.postman.com/t/how-to-ignore-response-when-it-fail/19346/3 "2021-01-21T01:40:28Z")

</div>

@technical-technologi Welcome to the Community 💐

So you are running the collections using Newman or Collection runner?

If using newman here are the list of newman commands.

[https://learning.postman.com/docs/running-collections/using-newman-cli/command-line-integration-with-newman/](https://learning.postman.com/docs/running-collections/using-newman-cli/command-line-integration-with-newman/)

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/d/b/db2a604167767eeb988ec53b71376ae75fda90d0.png)

---

<div class="post-metadata">

**Author:** ![technical-technologi](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/technical-technologi/32/7024_2.png) [@technical-technologi](https://community.postman.com/u/technical-technologi)\
**Post date:** [January 21, 2021, 4:59am UTC](https://community.postman.com/t/how-to-ignore-response-when-it-fail/19346/4 "2021-01-21T04:59:58Z")

</div>

Hi. What I meant is if the response has the object that I am testing for then it will run the test. But if the response do not have the object that is supposed to be then it will just skip run it and continue check the other responses. let me know if you want a better explaination

---

<div class="post-metadata">

**Author:** ![taehoshino](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/taehoshino/32/6608_2.png) [@taehoshino](https://community.postman.com/u/taehoshino)\
**Post date:** [January 21, 2021, 5:55am UTC](https://community.postman.com/t/how-to-ignore-response-when-it-fail/19346/5 "2021-01-21T05:55:37Z")

</div>

Hey @technical-technologi!

Thanks for clarification 😁  
In that case, maybe you can do something like this?

```
if (pm.response.json().SOMETHING) {
    // do something
} else {
   // do something else
}

```

Also, there is a JavaScript reference here that you might find useful 😉

> **[Test script examples](https://learning.postman.com/docs/writing-scripts/script-references/test-examples/)**
