# Invoke Later

**URL:** <https://forum.inductiveautomation.com/t/invoke-later/1371>\
**Category:** Archived Topics\
**Created:** [November 10, 2009, 12:47am UTC](https://forum.inductiveautomation.com/t/invoke-later/1371 "2009-11-10T00:47:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DB2](https://avatars.discourse-cdn.com/v4/letter/d/e0b2c6/32.png) [@DB2](https://forum.inductiveautomation.com/u/DB2)\
**Post date:** [November 10, 2009, 12:47am UTC](https://forum.inductiveautomation.com/t/invoke-later/1371/1 "2009-11-10T00:47:16Z")

</div>

I’m using the following code to select a particular field from a table and store the value in my root container,

`if(len({Root Container.Table 1.data}),
if({Root Container.Table 1.selectedRow} != -1,
toInt({Root Container.Table 1.data}[{Root Container.Table 1.selectedRow},0]),-1),-1)`

How would I use Invoke Later ‘fpmi.system.invokeLater(???,[1000])’ to cause a 1 second delay in the field selection?

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [November 10, 2009, 4:04am UTC](https://forum.inductiveautomation.com/t/invoke-later/1371/2 "2009-11-10T04:04:11Z")

</div>

The code you posted is an expression. fpmi.system.invokeLater is a function that is only available from a python script. There is no way to delay the calculation of an expression. The scripting way to do this would be to remove the expression binding and to put a script like this in the propertyChange event of the table:

`if event.propertyName=='data' or event.propertyName=='selectedRow':
   data = fpmi.db.toPyDataSet(event.source.data)
   row = event.source.selectedRow
   if len(data)>0 && row != -1:
      value = data[row][0]
      def doLater(event=event, value=value):
         # push the value into whatever the binding was bound to here, like this
         component = event.source.parent.getComponent("MyComponent")
         component.someProperty=value
      fpmi.system.invokeLater(doLater, 1000)`
