Loop over setNextRequest() function

Hi, I just create one logic. I receive array from API and make a loop to test them. Exactly this kind of loop.
list.map(item => {
if (item.type === 1) {
pm.test(#######, () => {
postman.setNextRequest("#####")
});
} else if (item.type === 2) {
pm.test(###, () => {
postman.setNextRequest("###")
})
} else {
pm.test(######, () => {
postman.setNextRequest(’###’)
})
}
})

I expect it will setNextRequest when postman see this condition. As an example if i have same type 4 out of items it means it should send 4times but actually setNextRequest() didn’t worked.

Do we have such kind of functionality

Setnextrequest doesn’t work as a queued process . It works as the last command wins .

So even if you call setnextrequest 100 times , the setnextrequest will be executed only once that’s for the last one (100th) .