# Pass a value of item in the selectedRow

**URL:** <https://forum.inductiveautomation.com/t/pass-a-value-of-item-in-the-selectedrow/4059>\
**Category:** Ignition\
**Created:** [February 23, 2012, 11:58pm UTC](https://forum.inductiveautomation.com/t/pass-a-value-of-item-in-the-selectedrow/4059 "2012-02-23T23:58:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ecujak](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@ecujak](https://forum.inductiveautomation.com/u/ecujak)\
**Post date:** [February 23, 2012, 11:58pm UTC](https://forum.inductiveautomation.com/t/pass-a-value-of-item-in-the-selectedrow/4059/1 "2012-02-23T23:58:48Z")

</div>

This code fails:

```auto
selectedRow = event.source.parent.parent.getComponent('Table_Trailers').selectedRow
if selectedRow = -1:
	system.gui.messageBox("Must select Row to update")
else:
	param1 = event.source.parent.parent.getComponent('Table_Trailers').data.getValueAt(selectedRow,"Record_ID")
	system.nav.openWindow('YARD/Yard_Update_PopUp', {'SelectedRow' : param1})
	system.nav.centerWindow('YARD/Yard_Update_PopUp')
```

![:scratch:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/76d1620bec252bfac07050c889ff5a91dc8a9c25.gif ":scratch:")

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [February 24, 2012, 12:04am UTC](https://forum.inductiveautomation.com/t/pass-a-value-of-item-in-the-selectedrow/4059/2 "2012-02-24T00:04:38Z")

</div>

Right, you need to have a double equals when checking for equality:`selectedRow = event.source.parent.parent.getComponent('Table_Trailers').selectedRow
if selectedRow == -1:
   system.gui.messageBox("Must select Row to update")
else:
   param1 = event.source.parent.parent.getComponent('Table_Trailers').data.getValueAt(selectedRow,"Record_ID")
   system.nav.openWindow('YARD/Yard_Update_PopUp', {'SelectedRow' : param1})
   system.nav.centerWindow('YARD/Yard_Update_PopUp')`

---

<div class="post-metadata">

**Author:** ![ecujak](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@ecujak](https://forum.inductiveautomation.com/u/ecujak)\
**Post date:** [February 24, 2012, 12:13am UTC](https://forum.inductiveautomation.com/t/pass-a-value-of-item-in-the-selectedrow/4059/3 "2012-02-24T00:13:12Z")

</div>

Sweet… I think I love you. Funny how something so small can be so frustrating.
