Iterating a file using Postman pre-request script

117 Views Asked by At

I want to post a single request to a bulk API. However, the JSON payload has to be constructed by iterating rows in a CSV file.

My idea was to use the Postman Runner in combination with a pre-request script where I would loop the rows in the file and concatenate each row into a string that, when done looping, would be sent as a single request to the API.

To achieve this it has to be possible to programmatically iterate through the rows in the file while getting the required values but without sending a request for each row.

Is this possible to achieve using pre-request scripts in Postman?

0

There are 0 best solutions below