How to inject/modify request payload values while running from Collection Runner

Hi All,

I have a collection of tests which I am trying to run through Runner. The problem is on of the request will generate a code (in the database) which i need to inject to the next request to make it work.

For example Request A generate a code in the database which I have to extract manually. This code is the payload for the next request to work.
How i can do it? any suggestion?

Note: this code not returned or exposed in the api response which means i can’t grab it and set as an env variable

Hi @debashish.jagadeba, welcome to the community! :wave:

I am afraid that if there’s no way through an API that you can reach the response / generated code, then it’s not possible via Postman to achieve it.

However, maybe you can write some system scripts (such as a python script / shell script) to automate this process or you can write an endpoint which returns this code after it gets generated.

Along with that you might be interested in exploring the CLI companion for postman which is newman and along those lines I think you can achieve some sort of automation around this as a workaround for this problem.

Maybe other people in the community have a solution to this / have faced this issue before?
I’ll be interested in hearing their thoughts on the same!