Loop for GET with different parameters from the file


There is Request GET for WEB service with List of parameters in the body

Question: How to create loop with different Requests from file, contains several sets of Parameters list? (see shapshot)

Hey @VadiksC :wave:

Welcome to the Postman Community! :postman:

You can iterate over a JSON or CSV data file using the Collection Runner.

This will then allow you to replace those hardcoded values in the request, with variables using the {{variable_name}} syntax.

We have a Level Up Video of this behaviour that will show you how this can be done. Some parts of the UI might be slightly different but this should still walkthrough the main parts.

Thanks for answer

If I send “data bulk” with more comprehensive structure (not Key + Value like in the video) in format of RAW data:


The following is a sample HTTP GET required: (from example above in specified linefeed format)
WS1 ---------> KEY
0437239C8AE5 ---------> {{variable_name}}

223090100 ---------> {{variable_name}}
ptD_Trim_Code_Recommendation ---------> {{variable_name}}

Here is Response: (for 2 lines of data)

Question: Is it possible to implement reading these parameters from a .csv or other file?

You can still use variables in a raw text body

For example…


You just need to ensure that your CSV file has a column header for each variable you want. So it may need a bit of work in formatting.

You use the special “data” element to to define the variable for the current iteration. So it would be data.columnheader (with the column header being the name of the variable).

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.