# Collection versus local variables

**URL:** <https://community.postman.com/t/collection-versus-local-variables/54316>\
**Category:** Help Hub\
**Tags:** variables\
**Created:** [November 6, 2023, 9:16am UTC](https://community.postman.com/t/collection-versus-local-variables/54316 "2023-11-06T09:16:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hannahbroch](https://avatars.discourse-cdn.com/v4/letter/h/ecae2f/32.png) [@hannahbroch](https://community.postman.com/u/hannahbroch)\
**Post date:** [November 6, 2023, 9:16am UTC](https://community.postman.com/t/collection-versus-local-variables/54316/1 "2023-11-06T09:16:11Z")

</div>

I want to create a collection run  
When saving variables, should i be setting collection variables or local variables?  
i tried setting a local variable but then it was only available for 1 request in the run and not any others

---

<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:** [November 6, 2023, 10:48am UTC](https://community.postman.com/t/collection-versus-local-variables/54316/2 "2023-11-06T10:48:48Z")

</div>

Local variables will only be available for that run.

Collection runs should persist between runs (as will Environment variables).

If its confidential information like access tokens or passwords, it should be the current value within an environment. (Current values do not sync to Postman Cloud and aren’t included if you export the environment).

---

<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:** [December 6, 2023, 10:48am UTC](https://community.postman.com/t/collection-versus-local-variables/54316/3 "2023-12-06T10:48:58Z")

</div>

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