# Global variable?

**URL:** <https://community.hubspot.com/t/global-variable/31509>\
**Category:** CMS Development\
**Created:** [February 9, 2021, 7:20pm UTC](https://community.hubspot.com/t/global-variable/31509 "2021-02-09T19:20:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ClaudiuP](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/claudiup/32/57633_2.png) [@ClaudiuP](https://community.hubspot.com/u/ClaudiuP)\
**Post date:** [February 9, 2021, 7:20pm UTC](https://community.hubspot.com/t/global-variable/31509/1 "2021-02-09T19:20:55Z")

</div>

Hi all, I would like to know how to define a kind of custom global variable that is accesible (to read and change) from inside and outside the scope of a for loop?

---

<div class="post-metadata">

**Author:** ![alyssamwilie](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/alyssamwilie/32/2072_2.png) [@alyssamwilie](https://community.hubspot.com/u/alyssamwilie)\
**Post date:** [February 9, 2021, 8:10pm UTC](https://community.hubspot.com/t/global-variable/31509/2 "2021-02-09T20:10:13Z")

</div>

Here’s a post whith a few options for how to do this :

[https://community.hubspot.com/t5/CMS-Development/How-to-change-a-variable-outside-of-a-for-loop-Scoping-Issues/td-p/211117](https://community.hubspot.com/t5/CMS-Development/How-to-change-a-variable-outside-of-a-for-loop-Scoping-Issues/td-p/211117)

---

<div class="post-metadata">

**Author:** ![ClaudiuP](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/claudiup/32/57633_2.png) [@ClaudiuP](https://community.hubspot.com/u/ClaudiuP)\
**Post date:** [February 9, 2021, 8:20pm UTC](https://community.hubspot.com/t/global-variable/31509/3 "2021-02-09T20:20:50Z")

</div>

thank you
