# Working with files convert integer into string

**URL:** <https://community.postman.com/t/working-with-files-convert-integer-into-string/13866>\
**Category:** Help Hub\
**Tags:** tests, variables, collections\
**Created:** [July 3, 2020, 2:04pm UTC](https://community.postman.com/t/working-with-files-convert-integer-into-string/13866 "2020-07-03T14:04:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emeon](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/emeon/32/4885_2.png) [@Emeon](https://community.postman.com/u/Emeon)\
**Post date:** [July 3, 2020, 2:04pm UTC](https://community.postman.com/t/working-with-files-convert-integer-into-string/13866/1 "2020-07-03T14:04:02Z")

</div>

Hi,

In my collection i created a POST request like this:

- Select: POST
- Url: {{url}}/api/v1/clients
- Body:  
o x-www-form-urlencoded  
o Bulk Edit:  
estate:{{clientsEstateTemoin}}  
id\_externe:{{clientsIdExterneTemoin}}  
langue:{{clientsLangueTemoin}}  
nom:{{clientsNomTemoin}}

Manual way, OK:  
If i set the “clientsEstateTemoin” variable in the “EDIT COLLECTION \> Variables” as 12 it will be sent as 12 via the body when i use the “Send” blue button

Run Way, KO:  
If i pass through “COLLECTION RUNNER”, select a json file with:  
[  
{  
“clientsEstateTemoin”: 12  
}  
]  
and run it i get a 400 cause “clientsEstateTemoin” has been sent has “12”, not 12 via the body.

Where do in need to specify to not convert all the values at strings ?

Regards,  
Emeon.

---

<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:** [July 3, 2020, 2:09pm UTC](https://community.postman.com/t/working-with-files-convert-integer-into-string/13866/2 "2020-07-03T14:09:46Z")

</div>

Hey @Emeon

How you specifying the variable in the POST body?

Is it like `"key": "{{var}}"` or `key: {{var}}`

---

<div class="post-metadata">

**Author:** ![Emeon](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/emeon/32/4885_2.png) [@Emeon](https://community.postman.com/u/Emeon)\
**Post date:** [July 3, 2020, 2:11pm UTC](https://community.postman.com/t/working-with-files-convert-integer-into-string/13866/3 "2020-07-03T14:11:39Z")

</div>

Hi @danny-dainton

It’s key:{{var}}

---

<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:** [July 3, 2020, 2:33pm UTC](https://community.postman.com/t/working-with-files-convert-integer-into-string/13866/4 "2020-07-03T14:33:15Z")

</div>

If you add something like to the pre request script:

```auto
let value = pm.iterationData.get('clientsEstateTemoin')

pm.variables.set("clientsEstateTemoin", parseInt(value))

```

Would that send it as an int? Make sure that if you’re making changes in the request builder, save them before running the collection in the Runner.

I’m going off memory and not at my machine at the moment so I might be incorrect here 😁

---

<div class="post-metadata">

**Author:** ![Emeon](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/emeon/32/4885_2.png) [@Emeon](https://community.postman.com/u/Emeon)\
**Post date:** [July 3, 2020, 2:54pm UTC](https://community.postman.com/t/working-with-files-convert-integer-into-string/13866/5 "2020-07-03T14:54:22Z")

</div>

It worked 👌

Thanks a lot !
