# Mapping CSV values to variables

**URL:** <https://community.postman.com/t/mapping-csv-values-to-variables/3578>\
**Category:** Help Hub\
**Created:** [December 12, 2018, 4:34pm UTC](https://community.postman.com/t/mapping-csv-values-to-variables/3578 "2018-12-12T16:34:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![plinnane](https://avatars.discourse-cdn.com/v4/letter/p/f475e1/32.png) [@plinnane](https://community.postman.com/u/plinnane)\
**Post date:** [December 12, 2018, 4:34pm UTC](https://community.postman.com/t/mapping-csv-values-to-variables/3578/1 "2018-12-12T16:34:44Z")

</div>

Hello all. First post here. I’m pretty new to working with APIs and am running into an issue. I have a CSV of values that I would like to map into a variable called sitename. The logic I have in mind is: Map value 1 into variable → POST → map value 2 into variable → POST → etc. etc. I’ve been trying to do this in collection runner but have yet to get it to properly fill. Here is the full JSON of my request:

{  
“profile”: {  
“name”: “{{sitename}}”,  
“description”: “Members of this group can access resources at the {{sitename}} site.”  
}  
}

Any help would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![matt](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/matt/32/2562_2.png) [@matt](https://community.postman.com/u/matt)\
**Post date:** [December 14, 2018, 7:33pm UTC](https://community.postman.com/t/mapping-csv-values-to-variables/3578/2 "2018-12-14T19:33:55Z")

</div>

Looks good so far!

What does your CSV look like? If you’re using `sitename` as the variable in your body, you must use `sitename` as your CSV column header, so at the most basic level your CSV might look like:

```auto
sitename
abc
def
ghi
jkl

```

This will iterate 4 times and swap out the value each time for the next row.

The documentation adds some extra context too:  
[https://learning.getpostman.com/docs/postman/collection\_runs/working\_with\_data\_files/#working-with-the-sample-files](https://learning.getpostman.com/docs/postman/collection_runs/working_with_data_files/#working-with-the-sample-files)
