# Loop for GET with different parameters from the file

**URL:** <https://community.postman.com/t/loop-for-get-with-different-parameters-from-the-file/51493>\
**Category:** Help Hub\
**Tags:** file, get-request\
**Created:** [September 7, 2023, 3:06pm UTC](https://community.postman.com/t/loop-for-get-with-different-parameters-from-the-file/51493 "2023-09-07T15:06:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![VadiksC](https://avatars.discourse-cdn.com/v4/letter/v/3be4f8/32.png) [@VadiksC](https://community.postman.com/u/VadiksC)\
**Post date:** [September 7, 2023, 3:06pm UTC](https://community.postman.com/t/loop-for-get-with-different-parameters-from-the-file/51493/1 "2023-09-07T15:06:10Z")

</div>

Hi,

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/5/9/5969adf7829aa0060e3e98919dd5bed47db1d088.png)

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)

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [September 7, 2023, 3:19pm UTC](https://community.postman.com/t/loop-for-get-with-different-parameters-from-the-file/51493/2 "2023-09-07T15:19:36Z")

</div>

Hey @VadiksC 👋

Welcome to the Postman Community! :postman:

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

> **[Importing data files | Postman Learning Center](https://learning.postman.com/docs/collections/running-collections/working-with-data-files/)**
>
> Importing data files: documentation for Postman, the collaboration platform for API development. Create better APIs—faster.

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.

[![](https://img.youtube.com/vi/RH8b3gbujPY/maxresdefault.jpg "Loop Through a Data File | Postman Level Up") ](https://www.youtube.com/watch?v=RH8b3gbujPY)

---

<div class="post-metadata">

**Author:** ![VadiksC](https://avatars.discourse-cdn.com/v4/letter/v/3be4f8/32.png) [@VadiksC](https://community.postman.com/u/VadiksC)\
**Post date:** [September 9, 2023, 2:47pm UTC](https://community.postman.com/t/loop-for-get-with-different-parameters-from-the-file/51493/3 "2023-09-09T14:47:16Z")

</div>

Thanks for answer

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

> WS1,0437239C8AE5  
> 223090100,ptD\_Trim\_Code\_Recommendation,Main.HS\_REFGENTRIM\_TUR.HS\_REFGEN\_PHY\_NORTH\_ATB\_VBG\_TRIM\_TUR,  
> 223090150,ptD\_Vbg\_at\_Coarse\_Trim\_Start,Main.HS\_REFGENTRIM\_TUR.HS\_REFGEN\_PHY\_NORTH\_ATB\_VBG\_TRIM\_TUR,

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}}**  
Main.HS\_REFGENTRIM\_TUR.HS\_REFGEN\_PHY\_NORTH\_ATB\_VBG\_TRIM\_TUR ---------\> **{{variable\_name}}**

Here is Response: (for 2 lines of data)

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/4/5/45620f5102185874a0e225968aa3c2646a411fc7.png)

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

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [September 12, 2023, 12:30pm UTC](https://community.postman.com/t/loop-for-get-with-different-parameters-from-the-file/51493/4 "2023-09-12T12:30:32Z")

</div>

You can still use variables in a raw text body

For example…

`WS1,{{data.variableName}}`

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).

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [October 27, 2023, 12:30pm UTC](https://community.postman.com/t/loop-for-get-with-different-parameters-from-the-file/51493/5 "2023-10-27T12:30:42Z")

</div>

Closed on October 27, 2023, 12:30pm UTC

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