# Scripting change to prefix in power table?

**URL:** <https://forum.inductiveautomation.com/t/scripting-change-to-prefix-in-power-table/11159>\
**Category:** Ignition\
**Created:** [February 2, 2016, 5:21pm UTC](https://forum.inductiveautomation.com/t/scripting-change-to-prefix-in-power-table/11159 "2016-02-02T17:21:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kstofcho](https://avatars.discourse-cdn.com/v4/letter/k/a9a28c/32.png) [@Kstofcho](https://forum.inductiveautomation.com/u/Kstofcho)\
**Post date:** [February 2, 2016, 5:21pm UTC](https://forum.inductiveautomation.com/t/scripting-change-to-prefix-in-power-table/11159/1 "2016-02-02T17:21:36Z")

</div>

Is it possible to change the prefix in a power table by using an extension function (configureCell?)? Additionally, is it possible to pull custom properties (that I defined using an expression function) into the extension functions? Thank you!

---

<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:** [February 2, 2016, 8:54pm UTC](https://forum.inductiveautomation.com/t/scripting-change-to-prefix-in-power-table/11159/2 "2016-02-02T20:54:07Z")

</div>

Hello,

What is a Power Table prefix? Or what do you mean by that?

What is a custom property that is defined in an expression function? Or what do you mean by that?

Maybe some screenshots showing what you are talking about might help.

Best,

---

<div class="post-metadata">

**Author:** ![Kstofcho](https://avatars.discourse-cdn.com/v4/letter/k/a9a28c/32.png) [@Kstofcho](https://forum.inductiveautomation.com/u/Kstofcho)\
**Post date:** [February 2, 2016, 9:54pm UTC](https://forum.inductiveautomation.com/t/scripting-change-to-prefix-in-power-table/11159/3 "2016-02-02T21:54:32Z")

</div>

Power table prefix: see first screenshot. Included in the table customizer options. In this case, it is “$” but I want the option to alternate between “$” and “hr” depending on what is chosen in an adjacent cell.

Custom property: In this case, it is a property titled “selectedID” that I created and used an expression binding to pull the selectedID (from SQL table). See second screenshot for code.

Thank you!

---

<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:** [February 2, 2016, 11:34pm UTC](https://forum.inductiveautomation.com/t/scripting-change-to-prefix-in-power-table/11159/4 "2016-02-02T23:34:45Z")

</div>

Okay, I see.

1. The prefix is a column in the “Column Attributes Data” dataset. It is only set per column, not per cell. However you can prefix any cell any way you want by using the configureCell extension function. Here’s an example:`if colName == "cost":
 	unitType = self.data.getValueAt(rowIndex,"UnitType")
 	if unitType == "Hourly":
 		return {"text": "hr"+textValue}
 	elif unitType == "Item":
 		return {"text": "$"+textValue}`
2. Sure you can reference any custom property in an extension function. For example: self.selectedID

Best,

---

<div class="post-metadata">

**Author:** ![Kstofcho](https://avatars.discourse-cdn.com/v4/letter/k/a9a28c/32.png) [@Kstofcho](https://forum.inductiveautomation.com/u/Kstofcho)\
**Post date:** [February 5, 2016, 5:29pm UTC](https://forum.inductiveautomation.com/t/scripting-change-to-prefix-in-power-table/11159/5 "2016-02-05T17:29:39Z")

</div>

Thank you Nick! I was able to complete everything I needed to with this help.

---

<div class="post-metadata">

**Author:** ![hachjessed](https://avatars.discourse-cdn.com/v4/letter/h/7ab992/32.png) [@hachjessed](https://forum.inductiveautomation.com/u/hachjessed)\
**Post date:** [August 16, 2019, 6:34pm UTC](https://forum.inductiveautomation.com/t/scripting-change-to-prefix-in-power-table/11159/6 "2019-08-16T18:34:52Z")

</div>

Is it possible to insert a property reference on an extension function?
