# swapTo variable window

**URL:** <https://forum.inductiveautomation.com/t/swapto-variable-window/35388>\
**Category:** Ignition\
**Created:** [June 7, 2020, 10:09pm UTC](https://forum.inductiveautomation.com/t/swapto-variable-window/35388 "2020-06-07T22:09:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![steve.richardson](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@steve.richardson](https://forum.inductiveautomation.com/u/steve.richardson)\
**Post date:** [June 7, 2020, 10:09pm UTC](https://forum.inductiveautomation.com/t/swapto-variable-window/35388/1 "2020-06-07T22:09:42Z")

</div>

Hi.  
I’m trying to navigate through buttons on a docked window with script like the following:  
system.nav.swapTo(“Main/”+[client]NextWin)  
where all the main windows are under the “Main” folder, and the NextWin string tag gets populated when each main window is opened.  
The swapTo function won’t accept the NextWin value.  
Where is my error?  
Thanks.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 7, 2020, 10:17pm UTC](https://forum.inductiveautomation.com/t/swapto-variable-window/35388/2 "2020-06-07T22:17:06Z")

</div>

You can’t just insert a tag name in a script. And curly braces are a binding tool, not a jython feature. Tags aren’t automatically injected into jython as variables, and their syntax isn’t python-compatible, anyways. You need to use one of the system.tag.read\*() script functions to retrieve the values. Read the manual carefully so you know what to do with the `QualifiedValue` objects you get from those.

---

<div class="post-metadata">

**Author:** ![steve.richardson](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@steve.richardson](https://forum.inductiveautomation.com/u/steve.richardson)\
**Post date:** [June 7, 2020, 11:43pm UTC](https://forum.inductiveautomation.com/t/swapto-variable-window/35388/3 "2020-06-07T23:43:23Z")

</div>

OK, so my error was missing the .value extension for the window variable.  
So it now looks more like:  
wind = system.tag.read("[client]NextWin").value  
system.nav.swapTo(“Main/”+wind)  
I assume this is the cleanest way to do it.
