Running Multiple Postman Requests with Different CSV Data Using skipRequest()

Publié le: 13 décembre 2025
sur la chaîne: vlogommentary
7
like

Learn how to run a Postman collection multiple times with CSV data, running one request fully before another by using the skipRequest() function to conditionally skip requests.
---
This video is based on the question https://stackoverflow.com/q/79515316/ asked by the user 'Oren Diaz' ( https://stackoverflow.com/u/8480731/ ) and on the answer https://stackoverflow.com/a/79517553/ provided by the user 'mikee' ( https://stackoverflow.com/u/22769054/ ) at 'Stack Overflow' website. Thanks to these great users and Stackexchange community for their contributions.

Visit these links for original content and any more details, such as alternate solutions, latest updates/developments on topic, comments, revision history etc. For example, the original title of the Question was: Run several requests with different number of data from csv on Postman

Also, Content (except music) licensed under CC BY-SA https://meta.stackexchange.com/help/l...
The original Question post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/... ) license, and the original Answer post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/... ) license.

If anything seems off to you, please feel free to drop me a comment under this video.
---
Problem Overview

You have a CSV file with data entries and a Postman collection containing two requests:

GetAge: uses the Name field

GetInfoCity: uses the City field

Your CSV looks like this:

[[See Video to Reveal this Text or Code Snippet]]

You want to run your collection so that the first request (GetAge) runs 4 times and the second request (GetInfoCity) runs 2 times, using the data in the CSV accordingly.

Key Challenge

Postman runs each request per iteration, iterating the data rows for each request. This means without control, every request runs for every row of data. To control how many times each request runs based on the data present, you need a way to conditionally skip requests.



Solution: Using skipRequest() to Control Execution

Postman’s scripting API provides pm.execution.skipRequest() to skip the current request during runtime based on custom logic.

How This Helps

For the GetAge request:

Since Name exists for all rows, it will run all 4 times.

For the GetInfoCity request:

Some rows have an empty City field.

Add a pre-request script that checks if City is present.

If City is empty or missing, skip the request.

This effectively runs the GetInfoCity request only for rows where City is available (2 times in this case).

Example Pre-request Script for GetInfoCity request

[[See Video to Reveal this Text or Code Snippet]]

How to Use

Attach this script to the pre-request tab of GetInfoCity.

Run the collection with the CSV data file attached.

Postman will:

Run GetAge for all 4 rows.

Skip GetInfoCity for rows where City is empty, effectively running it 2 times.



Summary

Use a single CSV with all your data.

Let GetAge run normally.

Add a pre-request script in GetInfoCity to skip requests when data is missing.

Leverage the power of pm.execution.skipRequest() to control request runs dynamically.

This approach keeps your collection simple and allows running requests different numbers of times based on your CSV data fields.


Sur cette page du site, vous pouvez voir la vidéo en ligne Running Multiple Postman Requests with Different CSV Data Using skipRequest() durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur vlogommentary 13 décembre 2025, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 7 fois et il a aimé like téléspectateurs. Bon visionnage!