# setNextRequest in Pre-Request - Skipping Call?

**URL:** <https://community.postman.com/t/setnextrequest-in-pre-request-skipping-call/860>\
**Category:** Help Hub\
**Created:** [February 1, 2018, 3:53pm UTC](https://community.postman.com/t/setnextrequest-in-pre-request-skipping-call/860 "2018-02-01T15:53:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmccann](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/tmccann/32/3550_2.png) [@tmccann](https://community.postman.com/u/tmccann)\
**Post date:** [February 1, 2018, 3:53pm UTC](https://community.postman.com/t/setnextrequest-in-pre-request-skipping-call/860/1 "2018-02-01T15:53:59Z")

</div>

If I have say 3 steps, **`A/B/C`**.  
Depending on env conditions, I want to skip the execution of **`Step A`** and go straight to **`B/C`**.

If I set a **`setNextRequest("Step B")`** statement in the pre-req tab of **`Step A`** , it still executes **`Step A`** and _then_ applies the workflow.

Is there a better way to do something like this? I know this would generally only be the case if the very first call is the one I want to skip. Is the only real way around this by adding a step before **`Step A`**?

Thx

---

<div class="post-metadata">

**Author:** ![dhoyt](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/dhoyt/32/238_2.png) [@dhoyt](https://community.postman.com/u/dhoyt)\
**Post date:** [February 2, 2018, 8:02pm UTC](https://community.postman.com/t/setnextrequest-in-pre-request-skipping-call/860/2 "2018-02-02T20:02:43Z")

</div>

@tmccann

Our API set has a “ping” endpoint that is used to test to see if the server is up. It simply returns …

```auto
{
    "ping": "Hello world."
}

```

If you have something like that or some sort of other diagnostic endpoint that could be run first, you could use that in your collection to test the environment in the “test” script and then decide if you need to skip A

So you would have … ping/A/B/C

---

<div class="post-metadata">

**Author:** ![shamasis](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/shamasis/32/53_2.png) [@shamasis](https://community.postman.com/u/shamasis)\
**Post date:** [February 4, 2018, 9:18pm UTC](https://community.postman.com/t/setnextrequest-in-pre-request-skipping-call/860/3 "2018-02-04T21:18:16Z")

</div>

Moving this to feature request.

@kamalaknn @harryi3t - this is a fine example of pm.break , etc

---

<div class="post-metadata">

**Author:** ![tmccann](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/tmccann/32/3550_2.png) [@tmccann](https://community.postman.com/u/tmccann)\
**Post date:** [February 5, 2018, 1:36pm UTC](https://community.postman.com/t/setnextrequest-in-pre-request-skipping-call/860/4 "2018-02-05T13:36:17Z")

</div>

@dhoyt This is kind of along the lines of what I was thinking but I do like your idea of the “ **Hello World** ” bit. I will implement something like that as well, clean and simple 🙂

@shamasis Thanks for putting this into a FR, it would be really nice to have something like this where we can evaluate before the call is made.

---

<div class="post-metadata">

**Author:** ![fa-enrollment](https://avatars.discourse-cdn.com/v4/letter/f/ecc23a/32.png) [@fa-enrollment](https://community.postman.com/u/fa-enrollment)\
**Post date:** [April 16, 2018, 10:19pm UTC](https://community.postman.com/t/setnextrequest-in-pre-request-skipping-call/860/5 "2018-04-16T22:19:33Z")

</div>

It’s critical for us to have a way to skip a request in the pre-script. The current call doesn’t always know which call should be next, but it does know if it should run or not. Without this, our Postman collection is a fragile and unreadable mess, where calls can’t even be renamed without breaking the entire flow.

---

<div class="post-metadata">

**Author:** ![jrsiegel](https://avatars.discourse-cdn.com/v4/letter/j/9d8465/32.png) [@jrsiegel](https://community.postman.com/u/jrsiegel)\
**Post date:** [July 30, 2018, 3:39pm UTC](https://community.postman.com/t/setnextrequest-in-pre-request-skipping-call/860/6 "2018-07-30T15:39:50Z")

</div>

If something is implemented where you can skip a request in the pre-script, there should be a part of the test results that shows how many requests were skipped.

---

<div class="post-metadata">

**Author:** ![kunagpal](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kunagpal/32/9_2.png) [@kunagpal](https://community.postman.com/u/kunagpal)\
**Post date:** [July 30, 2018, 3:42pm UTC](https://community.postman.com/t/setnextrequest-in-pre-request-skipping-call/860/7 "2018-07-30T15:42:58Z")

</div>

@jrsiegel That’s a great idea. Could you create a feature request here: [https://github.com/postmanlabs/postman-app-support/issues/new](https://github.com/postmanlabs/postman-app-support/issues/new)?

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [December 9, 2024, 2:34pm UTC](https://community.postman.com/t/setnextrequest-in-pre-request-skipping-call/860/8 "2024-12-09T14:34:44Z")

</div>

Closed on December 9, 2024, 2:34pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
