# Help with CSV data variable import

**URL:** <https://community.postman.com/t/help-with-csv-data-variable-import/19176>\
**Category:** Help Hub\
**Tags:** variables, collections, collection-runner\
**Created:** [January 14, 2021, 9:31pm UTC](https://community.postman.com/t/help-with-csv-data-variable-import/19176 "2021-01-14T21:31:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![research-architect-5](https://avatars.discourse-cdn.com/v4/letter/r/a587f6/32.png) [@research-architect-5](https://community.postman.com/u/research-architect-5)\
**Post date:** [January 14, 2021, 9:31pm UTC](https://community.postman.com/t/help-with-csv-data-variable-import/19176/1 "2021-01-14T21:31:49Z")

</div>

so i have been fiddling around with postman trying to make it so i can run one of my requests through the collection runner as a way to start automation. I was making significant progress until postman started importing one of my variables in the format i expected it too. the variable in question, zipcodevar, is supposed to hold a zip code which needs to be a 5-digit number or sting made up of numbers.

the problem i am having is that when i import the zip code from a csv file, it drops the leading zero in zip codes that start with a 0, take the Boston zip code 02135 for example, it would instead see 2135 as the value being used by postman for the request. this happens when i treat the variable as a string or number when using postman’s collection runner

---

<div class="post-metadata">

**Author:** ![bpricilla](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/bpricilla/32/6511_2.png) [@bpricilla](https://community.postman.com/u/bpricilla)\
**Post date:** [January 15, 2021, 2:24am UTC](https://community.postman.com/t/help-with-csv-data-variable-import/19176/2 "2021-01-15T02:24:47Z")

</div>

@research-architect-5 Welcome to the community 💐

You can try wrapping them in double quotes. Please spare a moment to read this [post](https://github.com/postmanlabs/postman-app-support/issues/6798#issuecomment-506642247).

Hope this helps 🙂

---

<div class="post-metadata">

**Author:** ![PradeepChintamani](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@PradeepChintamani](https://community.postman.com/u/PradeepChintamani)\
**Post date:** [January 16, 2021, 5:34pm UTC](https://community.postman.com/t/help-with-csv-data-variable-import/19176/3 "2021-01-16T17:34:12Z")

</div>

Hi Don Stevenson , so is it via running collection in runner if in case yes use the  
pm.iterationData.get(“Zipcode”)[this should be same as the name in csv cell name] in prerequest to autofill and pass the replace in body as

{  
“name”:“Boston”  
“Zipcode”:"{{csvcellname}}"  
}  
or other way is in excel while saving excel

1. Click on Export icon \> Export Data to CSV and the Save as CSV Options box opens.
2. Set the Text qualifier as either double or single quotes.
3. Set the Column delimiter as a comma.
4. Click OK.
5. Click Save – DO NOT OPEN THE CSV FILE DIRECTLY WITH EXCEL!
6. Open a new worksheet in Excel (see below for Excel screenshots.)
7. Select the Data tab.
8. Click on the From text icon to display the Import Text File dialog box.
9. Select the CSV file to import and click Import. The Text Import Wizard appears.
10. Select the Delimited radio button – Text Import Wizard, Step 1 determines that your data is delimited.
11. Select the row number where you want the import to start.
12. Check the My data has headers. box if true. Review the preview of the file at the bottom of the box.
13. Click Next
14. Check “Comma” as a delimiter (column dividers will appear in preview)-- Step 2 lets you set delimiters
15. Click Next
16. Highlight the column(s) with leading zeros in Step 3
17. Mark those columns format as “text” by clicking the radio button in the Column Data Format section. NOTE: You will need to do this for each column where the data contains leading zeros.
18. Click Finish, Import Data dialog box opens.
19. Click OK.
20. The leading zeros will still be there in the new worksheet with the imported data. The columns with real numbers will still be able to be used with calculations.

Hope this will work 🙂

---

<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 18, 2023, 3:58pm UTC](https://community.postman.com/t/help-with-csv-data-variable-import/19176/4 "2023-09-18T15:58:13Z")

</div>

A fix was added to the latest version (10.18) which handles the issue with leading zeros.

You can read more about that here:

> <https://github.com/postmanlabs/postman-app-support/issues/2734#issuecomment-1723384860>
>
> Postman Runner Removes leading "0" from values in .csv spreadsheet. 
> 
> This cau…ses tests to fail unless I create a new var, append a 0 then test against the new var.
> 
> !\[excelview\](https://cloud.githubusercontent.com/assets/10963335/23161300/85e65eb0-f821-11e6-8bc5-20ba03414391.JPG)
> !\[preiviewvie\](https://cloud.githubusercontent.com/assets/10963335/23161310/8df5a052-f821-11e6-9988-0aab51dc7371.JPG)
> 
> Postman for Windows
> Version 4.10.2
> win32 10.0.14393 / x64
> 
> 
> There is reference to a similar issue here that was closed but it does not seemed to have been resolved
> 
> https://github.com/postmanlabs/postman-app-support/issues/1917#issuecomment-200397668

---

<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 18, 2023, 3:58pm UTC](https://community.postman.com/t/help-with-csv-data-variable-import/19176/5 "2023-09-18T15:58:20Z")

</div>

Closed on September 18, 2023, 3:58pm UTC


