postman.setNextRequest not working

This would be the place to raise all Feature Requests :sweat:

As I don’t personally need this feature. I’ll let someone who really needs it to raise a request. :pleading_face:

It sounded like it or was worded like it was something you felt was missing or how the function could be improved. :heart:

Feature Requests, Improvements, Issues etc. raised on the Community Forum just get lost in threads of topics so it’s always best to raise them directly on the Public Tracker. :pray:

I’ve included the quick links to the forum site, which go directly to those forms on Github :trophy:

1 Like

@ngeeta123

I’ve created a Collection in my Public Workspace as a short term solution but I will be improving this and adding it to the Postman Answers Public Workspace. This is based on the Collection that @vdespa created for this video.

https://www.postman.com/dannysbattlefield/workspace/danny-dainton-s-public-workspace/collection/8213448-08f3e5d9-5382-4e0e-9aab-75ab9e07672a?action=share&source=copy-link&creator=8213448

This can be used to show you how you can achieve the flow that you’re looking to do - It’s only an example so it might need tweaking.

This scenario is controlled by a JSON data file:

[
    {
        "routes": [
            "Common",
            "Request 2",
            "Common",
            "Request 3",
            "Common",
            "Request 4",
            "Common"
        ]
    }
]

The principle behind that looks solid.

It’s a bit more re-usable than hardcoding the request that needs to run next into the requests test tab.

I would say its a bit more flexible and potentially more robust and easer to troubleshoot as you would be generally be checking the input file.

I guess you could also use this with an environment or collection variable instead of a data file.

1 Like

Thanks @danny-dainton it was really helpful

1 Like

Yeah, it’s just reading an array of routes, which could be in a number of places.

Would need a small change to the script but totally doable, depending on your context.