# Trouble using variable in system.tag.read statement

**URL:** <https://forum.inductiveautomation.com/t/trouble-using-variable-in-system-tag-read-statement/8191>\
**Category:** Ignition\
**Created:** [March 21, 2014, 1:06pm UTC](https://forum.inductiveautomation.com/t/trouble-using-variable-in-system-tag-read-statement/8191 "2014-03-21T13:06:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbackus](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tbackus/32/5091_2.png) [@tbackus](https://forum.inductiveautomation.com/u/tbackus)\
**Post date:** [March 21, 2014, 1:06pm UTC](https://forum.inductiveautomation.com/t/trouble-using-variable-in-system-tag-read-statement/8191/1 "2014-03-21T13:06:56Z")

</div>

Here is the hard coded statement that works…

LGW = system.tag.read(“QC\_Robot\_1/Standards/12ozBowl/LSL-GramWeight.Value”)

Here is the script I need to work…

selected = (event.source.parent.getComponent(‘Dropdown’).selectedLabel)  
LGW = system.tag.read(“QC\_Robot\_1/Standards/[color=#FF0040]selected[/color]/LSL-GramWeight.Value”)

My brain is not working this morning, whats the syntax for doing this?

---

<div class="post-metadata">

**Author:** ![diat150](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@diat150](https://forum.inductiveautomation.com/u/diat150)\
**Post date:** [March 21, 2014, 1:29pm UTC](https://forum.inductiveautomation.com/t/trouble-using-variable-in-system-tag-read-statement/8191/2 "2014-03-21T13:29:04Z")

</div>

[code]

selected = (event.source.parent.getComponent(‘Dropdown’).selectedLabel)  
LGW = system.tag.read(“QC\_Robot\_1/Standards/%s/LSL-GramWeight.Value” % selected)[/code]
