This code is not working as expected when running collection and used as a test script on the first request:
when console.log gives output null, the collection doesn't stop, when it should.
function never goes to the 'else' condition, even when I force it by changing the GET results.
pm.test("Any?", function () { var jsonData = pm.response.json(); if (pm.expect(jsonData.metadata.total_data).to.eql(0)) {console.log('null'); postman.setNextRequest(null);} else {console.log('Next request'); postman.setNextRequest('Name of Next request');} });