postman.SetNextRequest is not a function

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”);
}

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

pm.SetNextRequest should be lower case: pm.setNextRequest

2 Likes

Thank you for the response!

1 Like

Hey @Coxjeffrey,

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

Best,

Kevin

2 Likes