# Advantage of path variables over environment or global variables?

**URL:** <https://community.postman.com/t/advantage-of-path-variables-over-environment-or-global-variables/2697>\
**Category:** Help Hub\
**Created:** [September 17, 2018, 3:22pm UTC](https://community.postman.com/t/advantage-of-path-variables-over-environment-or-global-variables/2697 "2018-09-17T15:22:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mneiferbag](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/mneiferbag/32/11659_2.png) [@mneiferbag](https://community.postman.com/u/mneiferbag)\
**Post date:** [September 17, 2018, 3:22pm UTC](https://community.postman.com/t/advantage-of-path-variables-over-environment-or-global-variables/2697/1 "2018-09-17T15:22:30Z")

</div>

Hi all. Is there any advantage in using path variables over using environment or global variables in my request URLs? For example, is there any advantage in using

[https://example.com/:foo/bar](https://example.com/:foo/bar)

where :foo has value {{wombat}}, over using

[https://example.com/{{wombat}](https://example.com/%7B%7Bwombat%7D)}/bar

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![postman-harryi3t](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/postman-harryi3t/32/947_2.png) [@postman-harryi3t](https://community.postman.com/u/postman-harryi3t)\
**Post date:** [September 22, 2018, 4:26am UTC](https://community.postman.com/t/advantage-of-path-variables-over-environment-or-global-variables/2697/2 "2018-09-22T04:26:44Z")

</div>

Hi Markus

I am curious why you would be using a path variable `:foo` with a value which is again a variable `{{wormbat}}`.  
It just adds more complexity. Also, there have known issues with using path variables because of lack of a standard delimiter.  
Some users expect `https://example.com/:path.html` to resolve in `https://example.com/user.html` when `:path` be `user` and some would expect this to work only when `:path.html` to be `user`  
To avoid this complexity and confusion, I would recommend using environment, globals or collection variables.  
For e.g. this syntax `https://example.com/{{path}}.html` would have no confusion at all. It’s very clear what is expected to be replaced.

Let me know if you have a different use case where path variables are more helpful.

---

<div class="post-metadata">

**Author:** ![mneiferbag](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/mneiferbag/32/11659_2.png) [@mneiferbag](https://community.postman.com/u/mneiferbag)\
**Post date:** [September 24, 2018, 7:07am UTC](https://community.postman.com/t/advantage-of-path-variables-over-environment-or-global-variables/2697/3 "2018-09-24T07:07:15Z")

</div>

Thank you for your reply. I just got started using Postman and exploring its capabilities. I found path variables in the documentation and started using them. But I agree with you that non-path variables can easily replace path variables. Another problem with path variables is that they are not high-lighted in the URL input field. So they are easily overlooked. So far I found no use case were path variables are more useful.

Thanks again for sharing your thoughts.
