# What Variable type is best for path variables?

**URL:** <https://community.postman.com/t/what-variable-type-is-best-for-path-variables/26831>\
**Category:** Help Hub\
**Created:** [August 17, 2021, 3:22pm UTC](https://community.postman.com/t/what-variable-type-is-best-for-path-variables/26831 "2021-08-17T15:22:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TesterShaner](https://avatars.discourse-cdn.com/v4/letter/t/a8b319/32.png) [@TesterShaner](https://community.postman.com/u/TesterShaner)\
**Post date:** [August 17, 2021, 3:22pm UTC](https://community.postman.com/t/what-variable-type-is-best-for-path-variables/26831/1 "2021-08-17T15:22:13Z")

</div>

Are environment variables best for this? It seems too high level but I think that’s all that is working for parameterization of path variables in a request.

---

<div class="post-metadata">

**Author:** ![TesterShaner](https://avatars.discourse-cdn.com/v4/letter/t/a8b319/32.png) [@TesterShaner](https://community.postman.com/u/TesterShaner)\
**Post date:** [August 17, 2021, 4:15pm UTC](https://community.postman.com/t/what-variable-type-is-best-for-path-variables/26831/2 "2021-08-17T16:15:56Z")

</div>

Update: I think collection variables are best actually.

---

<div class="post-metadata">

**Author:** ![neilstudd](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/neilstudd/32/8213_2.png) [@neilstudd](https://community.postman.com/u/neilstudd)\
**Post date:** [August 18, 2021, 8:46am UTC](https://community.postman.com/t/what-variable-type-is-best-for-path-variables/26831/3 "2021-08-18T08:46:28Z")

</div>

Hi @TesterShaner,

It largely depends on your preference, but you might like to read the following documentation about variable scopes (and when they’re each recommended):

> **[Using variables](https://learning.postman.com/docs/sending-requests/variables/#variable-scopes)**

In general, collection variables are better if they’re for elements which would remain the same regardless of which environment you’re running against. So, consider this example URL below:

`{{baseUrl}}/customers/{{customerId}}`

In this situation, **baseUrl** would normally be set as an environment variable, so (for example) you can set the variable differently for your Production and Testing environments. On the other hand, **customerId** might be a collection variable, but only if you want to test with the same customer IDs in each environment; if the data is dynamic/different, then you may also want to set this as an environment variable.
