# "getDisplayTextAt" function use for table component

**URL:** <https://forum.inductiveautomation.com/t/getdisplaytextat-function-use-for-table-component/12383>\
**Category:** Ignition\
**Created:** [November 19, 2016, 8:48am UTC](https://forum.inductiveautomation.com/t/getdisplaytextat-function-use-for-table-component/12383 "2016-11-19T08:48:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![roshanbhosale](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/roshanbhosale/32/4899_2.png) [@roshanbhosale](https://forum.inductiveautomation.com/u/roshanbhosale)\
**Post date:** [November 19, 2016, 8:48am UTC](https://forum.inductiveautomation.com/t/getdisplaytextat-function-use-for-table-component/12383/1 "2016-11-19T08:48:14Z")

</div>

I want to know how to use “getDisplayTextAt” function in scripting of table component to read data at selected cell and display it in the text filed which is present in parent container.

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [November 21, 2016, 3:51pm UTC](https://forum.inductiveautomation.com/t/getdisplaytextat-function-use-for-table-component/12383/2 "2016-11-21T15:51:52Z")

</div>

getDisplayTextAt() is called for every cell in your table, not just the selected cell, and returns a string to be displayed in that cell. It’s used to alter what’s displayed in cells of the table.

---

<div class="post-metadata">

**Author:** ![roshanbhosale](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/roshanbhosale/32/4899_2.png) [@roshanbhosale](https://forum.inductiveautomation.com/u/roshanbhosale)\
**Post date:** [November 22, 2016, 9:10am UTC](https://forum.inductiveautomation.com/t/getdisplaytextat-function-use-for-table-component/12383/3 "2016-11-22T09:10:03Z")

</div>

Thanks for the reply.

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [November 22, 2016, 10:13am UTC](https://forum.inductiveautomation.com/t/getdisplaytextat-function-use-for-table-component/12383/4 "2016-11-22T10:13:30Z")

</div>

Hi roshanbhosale,

As Kathy said, the getDisplayTextAt() function is called for every cell and is used to return the text that is displayed in each cell of a table.

For what you want to do I recommend a propertyChange script on the table like this:

`if event.propertyName in ["selectedColumn","selectedRow"]:
	value = str(event.source.data.getValueAt(event.source.selectedRow,event.source.selectedColumn))
	event.source.parent.getComponent('Text Field').text = value`Each time a different cell is selected the text box is updated with the text.

Best,

---

<div class="post-metadata">

**Author:** ![roshanbhosale](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/roshanbhosale/32/4899_2.png) [@roshanbhosale](https://forum.inductiveautomation.com/u/roshanbhosale)\
**Post date:** [November 24, 2016, 5:46pm UTC](https://forum.inductiveautomation.com/t/getdisplaytextat-function-use-for-table-component/12383/5 "2016-11-24T17:46:42Z")

</div>

thanks for reply…

---

<div class="post-metadata">

**Author:** ![paulm1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paulm1/32/5900_2.png) [@paulm1](https://forum.inductiveautomation.com/u/paulm1)\
**Post date:** [August 8, 2018, 12:52am UTC](https://forum.inductiveautomation.com/t/getdisplaytextat-function-use-for-table-component/12383/6 "2018-08-08T00:52:14Z")

</div>

I have a similar question concerning getDisplayTextAt extension function of a table component.  
I tried entering the following -

```auto
if colName == 'Action':
			if value > 0:
				return {'text': 'Hold','foreground': system.gui.color(255,0,0)}
			else: 
				return {'text': 'Crash','foreground': system.gui.color (0,128,0)}

```

I get no change at all to my table. I’m trying to have text displayed based on the value of the column ‘Action’
