Calling postman requests

My project structure is little complexed which means we are having many subfolders inside collection…For example…
I will have 2 requests in sub folder named test-1 and another 2 requests in another subfolder named test-2.
Like that we will have n number of subfolders inside collection.
My problem is that want to call test-1 folder requests in all other folders because it will have login token generation requests…Is it possible in postman

when tried to call a request using pm.sendRequest(“req name”)…got error

Hey @rajeswariramar :wave:

Welcome to the Postman community :postman:

That’s not how pm.sendRequest() works, that’s an async request which has a set of arguments.

You can use pm.execution.setNextRequest('request_name') in the post response script to create a workflow - you can incorporate a level of logic to this too.

I did create a Collection with an example of how you could route requests in a certain sequence:

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

1 Like