Created
July 27, 2017 19:24
-
-
Save JamesMessinger/1e6702e0c96be032d905adb274727baa to your computer and use it in GitHub Desktop.
setNextRequest() example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var customer = JSON.parse(responseBody); | |
if (customer.id === undefined) { | |
// No customer was returned, so don't run the rest of the collection | |
postman.setNextRequest(null); | |
} | |
else { | |
// Save the customer ID to a Postman environment variable | |
postman.setEnvironmentVariable("cust_id", customer.id); | |
// The "Edit Customer" request uses the "cust_id" variable | |
postman.setNextRequest('Edit Customer'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment