# postman.SetNextRequest is not a function

**URL:** <https://community.postman.com/t/postman-setnextrequest-is-not-a-function/16579>\
**Category:** Help Hub\
**Tags:** setnextrequest\
**Created:** [October 8, 2020, 10:45am UTC](https://community.postman.com/t/postman-setnextrequest-is-not-a-function/16579 "2020-10-08T10:45:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Coxjeffrey](https://avatars.discourse-cdn.com/v4/letter/c/b3f665/32.png) [@Coxjeffrey](https://community.postman.com/u/Coxjeffrey)\
**Post date:** [October 8, 2020, 10:45am UTC](https://community.postman.com/t/postman-setnextrequest-is-not-a-function/16579/1 "2020-10-08T10:45:22Z")

</div>

I’m trying to run a request if an variable’s condition is good.

When I run this in the postman runner I get the error that postman.SetNextRequest is not a function?

I’m on v6.7.4 of Postman.

My Code:  
if (postman.getEnvironmentVariable(“Progress”) == “Done”) {  
pm.setNextRequest(“Remove”);  
} else {  
pm.SetNextRequest(“GetQueue”);  
}

---

<div class="post-metadata">

**Author:** ![allenheltondev](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/allenheltondev/32/31738_2.png) [@allenheltondev](https://community.postman.com/u/allenheltondev)\
**Post date:** [October 8, 2020, 11:45am UTC](https://community.postman.com/t/postman-setnextrequest-is-not-a-function/16579/2 "2020-10-08T11:45:55Z")

</div>

In your else statement, you have a capital S in your function name

`pm.SetNextRequest` should be lower case: `pm.setNextRequest`

---

<div class="post-metadata">

**Author:** ![Coxjeffrey](https://avatars.discourse-cdn.com/v4/letter/c/b3f665/32.png) [@Coxjeffrey](https://community.postman.com/u/Coxjeffrey)\
**Post date:** [October 8, 2020, 12:11pm UTC](https://community.postman.com/t/postman-setnextrequest-is-not-a-function/16579/3 "2020-10-08T12:11:42Z")

</div>

Thank you for the response!

---

<div class="post-metadata">

**Author:** ![kevin.swiber](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kevin.swiber/32/3820_2.png) [@kevin.swiber](https://community.postman.com/u/kevin.swiber)\
**Post date:** [October 8, 2020, 5:59pm UTC](https://community.postman.com/t/postman-setnextrequest-is-not-a-function/16579/4 "2020-10-08T17:59:43Z")

</div>

Hey @Coxjeffrey,

Note that the function call should be `postman.setNextRequest`, not `pm.setNextRequest`. It’s an artifact of the legacy API.

Best,

Kevin
