Send multiple get request and then a single post request

Dear Community,
I’ve just been testing a few things on postman. Extremely new to using postman to. Here’s what i want to do your support would be highly appreciated:

Basically I want to send multiple get request and extract a single data from the body that data is “ltp” i want to then multiply the ltp value by 5% and then send a post request. Example and what i have is below:

Response Body:
“status”: “200”,
“level”: null,
“message”: “Success”,
“data”: {
“ltp”: 5,
“Price”: 5.6,
“High”: 5.6,

This is what i have on Tests:

const response = pm.response.json();

when I run it I get the ltp as 5 i now want to multiply that by 5% and send a post request with the new value. The get has to run multiple times say for example a 100 times to be able to continuously read the value of ltp on the server and say for example on the 58th get request the value of ltp has changed from 5 to 5.1 so i want to send a post request after that.


This is a fairly complicated scenario, but it can be achieved using pre-requests to retrieve the current value to be used in the current GET request and the tests tab to provide the loop. This can be accomplished with a single request.

In the tests tab, you would save the latest value back to the global variable (with your 5%), and then use an IF statement and setNextRequest to keep sending the same request until the value hits the threshold.

Combine the ELSE part of that IF statement with sendRequest to POST your data, and setNextRequest(null) to break the loop.

Can you please give me a code example

I don’t have a ready made example.

You will need to try this yourself and if you still need help, you can then post your example code and screenshots.

You are more likely to get a response that way.

I doubt anyone will just write the code for you.

It is a fairly complicated scenario, so if you haven’t done so already, you may need to learn a bit of JavaScript first. W3Schools is a good place to start.

I had a bit of time today, so I created a simple example.

This is using a POST request to Postman Echo to loop through the responses.
The final request is a GET request to Postman Echo.

I’ve not done the 5% logic, but I’ve just incremented ltp by 1 each time until I hit 10.
You’ll have to code that bit yourself.

Using a very simple body with the ltp value coming from a collection variable. (Initially set to 5).

"ltp": {{ltp}},
"Price": 5.6,
"High": 5.6

This is the Tests tab.

response = pm.response.json()
var currentltp =;

pm.test(`ltp=${currentltp} - Status code is 200`, () => {;

if (currentltp < 10){

    currentltp++; // increment by 1
    postman.setNextRequest("Request_Name"); // keep looping until ltp is more than 10

} else {
        url: '' + currentltp,
        method: 'GET',
     }, function (err, res) {
        if (err) {
        } else {
            pm.test("Final GET Request - Status code is 200", () => {
            let resJson = res.json();

            pm.test("Final GET Request - ltp=10", () => {
                // console.log(resJson);    


    pm.collectionVariables.set("ltp",currentltp);  // 11
    // the pre-request script will set ltp back to 5 once it hits 11

    postman.setNextRequest(null); // break the loop


I’ve also added a tiny bit of code to the Pre-request script to set ltp back to 5 once the threshold has been hit. (So I don’t have to go and reset the variable each time I run the test).

var currentltp = pm.collectionVariables.get("ltp");

if(currentltp === 11){
    pm.collectionVariables.set("ltp",5); // set LTP back to 5.

Thanks a million, I’ll Give it a try,
This is what i was trying one baby step at a time

const response = pm.response.json();
pm.test("2%", function() {
    var value =;
    var result = * 1.02;
    var roundedResult = Math.floor(result * 10) / 10;
    pm.globals.set("abc", roundedResult);

Now I need to understand the if and else part and only need the get request to run in a loop till the value changes and then it sends a post request.