# Global Variable

**URL:** <https://forum.inductiveautomation.com/t/global-variable/23194>\
**Category:** Ignition\
**Created:** [March 9, 2019, 4:52pm UTC](https://forum.inductiveautomation.com/t/global-variable/23194 "2019-03-09T16:52:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dcamp1](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@dcamp1](https://forum.inductiveautomation.com/u/dcamp1)\
**Post date:** [March 9, 2019, 4:52pm UTC](https://forum.inductiveautomation.com/t/global-variable/23194/1 "2019-03-09T16:52:10Z")

</div>

I can’t figure this out.

I’m trying to set a GLOBAL variable.  
ConfimIndex = 1

I want to be able to read ConfirmIndex from anywhere in the program(all screens)

I have tried system.util.getGlobal()[ConfirmIndex] = 1

But come back with a script error says  
ConfirmIndex has not been defined.

Can anyone help?  
Thanks

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [March 9, 2019, 5:20pm UTC](https://forum.inductiveautomation.com/t/global-variable/23194/2 "2019-03-09T17:20:55Z")

</div>

Can you just create a memory tag and reference that?

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [March 9, 2019, 5:38pm UTC](https://forum.inductiveautomation.com/t/global-variable/23194/3 "2019-03-09T17:38:37Z")

</div>

If you put the variable in project startup scripts and access them with full path (e.g. project.NewScript.blahblah ) it should work!

---

<div class="post-metadata">

**Author:** ![chi](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@chi](https://forum.inductiveautomation.com/u/chi)\
**Post date:** [March 9, 2019, 9:32pm UTC](https://forum.inductiveautomation.com/t/global-variable/23194/4 "2019-03-09T21:32:21Z")

</div>

> [@dcamp1](#):
>
> I have tried system.util.getGlobal()[ConfirmIndex] = 1

Try

```auto
system.util.getGlobals()['ConfirmIndex']

```

ConfirmIndex is treated as a variable without the qoutes.

---

<div class="post-metadata">

**Author:** ![dcamp1](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@dcamp1](https://forum.inductiveautomation.com/u/dcamp1)\
**Post date:** [March 9, 2019, 10:34pm UTC](https://forum.inductiveautomation.com/t/global-variable/23194/5 "2019-03-09T22:34:19Z")

</div>

Thanks everyone, I like the Idea of using a memory tag, but I will play with the other ways also.

I’m still learning so all help is greatly appreciated.
