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