# How to remove Double Quotes in Data Driven for GET Method

**URL:** <https://community.postman.com/t/how-to-remove-double-quotes-in-data-driven-for-get-method/58073>\
**Category:** Help Hub\
**Tags:** get, data-driven\
**Created:** [February 25, 2024, 1:55am UTC](https://community.postman.com/t/how-to-remove-double-quotes-in-data-driven-for-get-method/58073 "2024-02-25T01:55:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![blizzard-wolfang](https://avatars.discourse-cdn.com/v4/letter/b/b487fb/32.png) [@blizzard-wolfang](https://community.postman.com/u/blizzard-wolfang)\
**Post date:** [February 25, 2024, 1:55am UTC](https://community.postman.com/t/how-to-remove-double-quotes-in-data-driven-for-get-method/58073/1 "2024-02-25T01:55:12Z")

</div>

Hello Maam/Sir.

Absolute newbie for Postman.

I’m currently having an issue on reading datadriven values that are enclosed in double quotations using csv file. Sample datadriven in csv file:

pageNumber  
“2”  
“3”

I already declared variables in local environment, in the endpoint and in the Params

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

And here’s my javascript code for reading the data. I tried to use the .slice function to remove the double quotes when reading the values in the csv file.

parameters = [‘pageNumber’]

for (i=0; i\<parameters.length; i++)  
{  
readValueInCSV = pm.iterationData.get(parameters[i]);  
console.log ("Value of pageNumber: " + readValueInCSV);

```
temp = readValueInCSV;
temp = temp.slice(1, temp.length-1);
console.log ("Value of pageNumber after slice: " + temp);
pm.environment.set(parameters[i], temp)

```

}

After running the datadriven, the double quotations were actually removed in the local environment. Please see screenshot below:

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/a/1/a1e65c40305d04b8a87a297a9e5a90e8c0d83c37.png)

However, based on the results the endpoint fetched, there were still characters displayed. See screenshot below (these diamonds with question marks).

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/8/9/89e97fbf45d77d9e093ea48a3f8f09037f647b80.png)

My point is… I want to read datas enclosed in double quotation marks and store them in local environment variables that can be passed to the Params and using only GET Method.

My expected endpoints displayed should be like these:  
GET [https://reqres.in/api/users?page=2](https://reqres.in/api/users?page=2)  
GET [https://reqres.in/api/users?page=3](https://reqres.in/api/users?page=3)

instead of:  
GET [https://reqres.in/api/users?page=�2�](https://reqres.in/api/users?page=%EF%BF%BD2%EF%BF%BD)  
GET [https://reqres.in/api/users?page=�3�](https://reqres.in/api/users?page=%EF%BF%BD3%EF%BF%BD)

---

<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:** [February 25, 2024, 3:32pm UTC](https://community.postman.com/t/how-to-remove-double-quotes-in-data-driven-for-get-method/58073/2 "2024-02-25T15:32:00Z")

</div>

No need to use slice, just use parseInt when you store the environment variable.

---

<div class="post-metadata">

**Author:** ![blizzard-wolfang](https://avatars.discourse-cdn.com/v4/letter/b/b487fb/32.png) [@blizzard-wolfang](https://community.postman.com/u/blizzard-wolfang)\
**Post date:** [February 26, 2024, 11:34am UTC](https://community.postman.com/t/how-to-remove-double-quotes-in-data-driven-for-get-method/58073/3 "2024-02-26T11:34:35Z")

</div>

Thanks for the response, but i really need the data to be string. I don’t need  
to parseInt anything.

Also, I only used reqres.in website as an example. The data I needed are supposed to be combinations of strings and numbers.

For example:  
“B203”, “999P”, “888B”, “GHS9”, “23IO” etc.

---

<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:** [February 26, 2024, 12:10pm UTC](https://community.postman.com/t/how-to-remove-double-quotes-in-data-driven-for-get-method/58073/4 "2024-02-26T12:10:53Z")

</div>

I’ve tested this with Postman Echo and I’m not able to replicate your issue.

The data file looks like this, and the numbers are enclosed in strings.

![image](https://us1.discourse-cdn.com/getpostman/original/3X/e/e/ee88db7abff048cf3ae3976c8acddeeaee9a33e9.png)

(Can you preview your CSV file in the runner, is it the same as above, or does there appear to be extra characters included?)

The request looks like this…

![image](https://us1.discourse-cdn.com/getpostman/original/3X/f/0/f04c5e26b1f2a1f9d000b1a7f5e8476b8d8a7a51.png)

I have the following in the pre-request script.

![image](https://us1.discourse-cdn.com/getpostman/original/3X/6/5/6505ea3e0c15224e728c8b09d2a0a8160f299e80.png)

This appears to run ok, and doesn’t seem to be adding extra quotes to the query parameter value.

![image](https://us1.discourse-cdn.com/getpostman/original/3X/8/0/80aa8a009876e51983275eadd0c17af44e8d9e32.png)

data is a special variable which will show you the current line the CSV file as a JSON object. (Pretty much the same as pm.iterationData).

---

<div class="post-metadata">

**Author:** ![blizzard-wolfang](https://avatars.discourse-cdn.com/v4/letter/b/b487fb/32.png) [@blizzard-wolfang](https://community.postman.com/u/blizzard-wolfang)\
**Post date:** [February 28, 2024, 1:00pm UTC](https://community.postman.com/t/how-to-remove-double-quotes-in-data-driven-for-get-method/58073/5 "2024-02-28T13:00:29Z")

</div>

Hi Sir,

Sorry for the late response. I finally got it! Thank you very much for informing me about that “data” special variable. My concern has been completely answered.

I was able to traverse and loop through all the items in the JSON file by using the data variable.

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/5/6/56218eff39f2c9a0f89d523c99d154651f264f13.png)

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

Also, my mistake because i got a different double quotes after i opened it in notepad++. That’s why in Postman they displayed diamonds with question marks.  
 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/a/d/adc5b4aeee98d9ce2ce9086e6aa7ca379099b668.png)

---

<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:** [March 29, 2024, 1:00pm UTC](https://community.postman.com/t/how-to-remove-double-quotes-in-data-driven-for-get-method/58073/6 "2024-03-29T13:00:40Z")

</div>

Closed on March 29, 2024, 1:00pm UTC

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