# Whats the best way to edit variables

**URL:** <https://community.postman.com/t/whats-the-best-way-to-edit-variables/8799>\
**Category:** Help Hub\
**Tags:** collections\
**Created:** [November 5, 2019, 2:05pm UTC](https://community.postman.com/t/whats-the-best-way-to-edit-variables/8799 "2019-11-05T14:05:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![theToncheff](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@theToncheff](https://community.postman.com/u/theToncheff)\
**Post date:** [November 5, 2019, 2:05pm UTC](https://community.postman.com/t/whats-the-best-way-to-edit-variables/8799/1 "2019-11-05T14:05:32Z")

</div>

Hello, I’ve created a collection that would use a single variable in several different requests, currently I’m storing this variable in a custom environment (variable is an email in case it matters), anyway I’m wondering if there is a better way to store and edit the variable or this is the most optimal one?

---

<div class="post-metadata">

**Author:** ![arlem](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/arlem/32/3078_2.png) [@arlem](https://community.postman.com/u/arlem)\
**Post date:** [November 6, 2019, 10:26am UTC](https://community.postman.com/t/whats-the-best-way-to-edit-variables/8799/2 "2019-11-06T10:26:43Z")

</div>

Hey @theToncheff,

If the value of the variable is meant to stay the same regardless of the environment you’ve selected you may want to use Global Variables to store its value:  
[https://learning.getpostman.com/docs/postman/environments-and-globals/manage-globals/](https://learning.getpostman.com/docs/postman/environments-and-globals/manage-globals/)

Though if you need that variable only when using a specific environment then the Environment variables are the way to go!

---

<div class="post-metadata">

**Author:** ![theToncheff](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@theToncheff](https://community.postman.com/u/theToncheff)\
**Post date:** [November 6, 2019, 11:07am UTC](https://community.postman.com/t/whats-the-best-way-to-edit-variables/8799/3 "2019-11-06T11:07:28Z")

</div>

I’m currently using environment to store the variables as they would be specific to certain collections, although I might want to eventually use around 15 variables that would be called through the body - raw json. It seems like too much work but also the most convenient way?

side question, would it be possible to use the raw json for format data in body, that would probably make it easier to edit the information for the post request?

---

<div class="post-metadata">

**Author:** ![vdespa](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/vdespa/32/2770_2.png) [@vdespa](https://community.postman.com/u/vdespa)\
**Post date:** [November 6, 2019, 12:01pm UTC](https://community.postman.com/t/whats-the-best-way-to-edit-variables/8799/4 "2019-11-06T12:01:00Z")

</div>

If your variables are tight to your collection, it makes sense to use Collection variables.

 ![25](https://us1.discourse-cdn.com/getpostman/original/3X/c/d/cdbd8b2123d56e617a9f5ebdbdf94b5145b8b2b7.png)

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

I consider it a bad practice to use globals =\> read here why: [Demystifying Postman Variables: HOW and WHEN to use Different Variable Scopes | by Valentin Despa | APIs with Valentine | Medium](https://link.medium.com/EbG8Spzuo1)  
Using environment variables if you don’t have multiple environments, does not make so much sense.

* * *

Regarding your side question (which is always great to ask separately so that others can find it as well): if you want to have more control over the body, I would suggest the approach I have described in this video: [https://www.youtube.com/watch?v=hSX7Dcjy000](https://www.youtube.com/watch?v=hSX7Dcjy000)

In a nutshell, you create your request body in the pre-request, something like this:

 ![26](https://us1.discourse-cdn.com/getpostman/original/2X/d/d66046d6c8221b0794cf0a4a4db8c0ba4a00d27b.jpeg)
