# Public Variables

**URL:** <https://rossvideo.community/t/public-variables/8212>\
**Category:** Automation & Control\
**Created:** [October 15, 2018, 8:08pm UTC](https://rossvideo.community/t/public-variables/8212 "2018-10-15T20:08:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![caidblank](https://rossvideo.community/letter_avatar_proxy/v4/letter/c/a9adbd/32.png) [@caidblank](https://rossvideo.community/u/caidblank)\
**Post date:** [October 15, 2018, 8:08pm UTC](https://rossvideo.community/t/public-variables/8212/1 "2018-10-15T20:08:00Z")

</div>

Hi,

perhaps this is a simple question but I didn’t find the solution.

I use this script to declare my variables:

var teamA="myTeam"; var teamB="yourTeam"; var And what I want to do is when I click on my button I would like my variables update. So here is my script. / %const['globVars']['vars']%; teamA="TEAM A"; teamB="TEAM B"; ogscript.debug(teamA); ogscript.debug(teamB); But debug always return "myTeam" and "yourTeam" and not "TEAM A" and "TEAM B".

How can I proceed please ?

Thanks

---

<div class="post-metadata">

**Author:** ![jamespeltzer](https://rossvideo.community/user_avatar/rossvideo.community/jamespeltzer/32/50_2.png) [@jamespeltzer](https://rossvideo.community/u/jamespeltzer)\
**Post date:** [October 15, 2018, 11:06pm UTC](https://rossvideo.community/t/public-variables/8212/2 "2018-10-15T23:06:00Z")

</div>

When you use %const[‘lookup\_id’][‘key’]% it is the equivalent of writing that exact string of text in your script. In this case, the script in the button is throwing an exception but that may be a copy/paste issue. If I type:

 var teamA="myTeam"; var teamB="yourTeam"; (remove the extra "var" at the end)

and remove the “/” at the start of:

 %const['globVars']['vars']%; teamA="TEAM A"; teamB="TEAM B"; ogscript.debug(teamA); ogscript.debug(teamB); I do get "TEAM A" and "TEAM B" printed.

That said, I strongly-recommend you reconsider your approach here. Using look-ups to store blocks of script was a common approach before the tag was created. Now that it exists, you are better-off declaring your common code and variables in one of those tags and working with them directly.

var teamA=“myTeam”;  
var teamB=“yourTeam”;  
  
teamA=“TEAM A”;  
teamB=“TEAM B”;  
ogscript.debug(teamA);  
ogscript.debug(teamB);  
  
[#DashBoard](https://livinglive.community/search?s=tags%3A%22DashBoard%22&executesearch=true)

---

<div class="post-metadata">

**Author:** ![caidblank](https://rossvideo.community/letter_avatar_proxy/v4/letter/c/a9adbd/32.png) [@caidblank](https://rossvideo.community/u/caidblank)\
**Post date:** [October 16, 2018, 1:56pm UTC](https://rossvideo.community/t/public-variables/8212/3 "2018-10-16T13:56:00Z")

</div>

Sorry James, I write my script directly in the post and I make mistake.

But you understood what I try to do.

So now I go to change my approach to declare variables, and use tag for this.

I try it and it works good.

Thanks a lot.  
[#DashBoard](https://livinglive.community/search?s=tags%3A%22DashBoard%22&executesearch=true)
