# \[Perspective\] Table Highlight Row Based on Property Name or Text

**URL:** <https://forum.inductiveautomation.com/t/perspective-table-highlight-row-based-on-property-name-or-text/59574>\
**Category:** Ignition\
**Created:** [May 14, 2022, 5:50pm UTC](https://forum.inductiveautomation.com/t/perspective-table-highlight-row-based-on-property-name-or-text/59574 "2022-05-14T17:50:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![byrcharl](https://avatars.discourse-cdn.com/v4/letter/b/e79b87/32.png) [@byrcharl](https://forum.inductiveautomation.com/u/byrcharl)\
**Post date:** [May 14, 2022, 5:50pm UTC](https://forum.inductiveautomation.com/t/perspective-table-highlight-row-based-on-property-name-or-text/59574/1 "2022-05-14T17:50:45Z")

</div>

I am looking for a way to highlight the row that matches the string below. I am querying a database for the info. Desired output:

 ![2022-05-14_10-42-31](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/f/ff98eeab0ab992ba703b7308de3952cf22ed26e4.png)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 14, 2022, 6:40pm UTC](https://forum.inductiveautomation.com/t/perspective-table-highlight-row-based-on-property-name-or-text/59574/2 "2022-05-14T18:40:19Z")

</div>

The standard way to do that is to run a script transform on the value returned by the data binding - assuming that your table data is the result of an SQL query of some type. The transform will modify the style of the selected row. Have a look at the **data** structure of the table component’s default data and, in particular, the Folsom highlighting.

There’s a little more in [Perspective - Table - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/Perspective+-+Table) under the _data_ properties.

```auto
city: {
  value: 'Folsom',
  editable: true,
  style: {
    backgroundColor: 'grey',
    classes: [] | ''
  }
}

```

---

<div class="post-metadata">

**Author:** ![byrcharl](https://avatars.discourse-cdn.com/v4/letter/b/e79b87/32.png) [@byrcharl](https://forum.inductiveautomation.com/u/byrcharl)\
**Post date:** [May 14, 2022, 7:09pm UTC](https://forum.inductiveautomation.com/t/perspective-table-highlight-row-based-on-property-name-or-text/59574/3 "2022-05-14T19:09:35Z")

</div>

Yes . i didnt scroll far enough haha \>\>\>

> def transform(self, value, quality, timestamp):  
> """  
> Transform the incoming value and return a result.

```
Arguments:
	self: A reference to the component this binding is configured on.
	value: The incoming value from the binding or the previous transform.
	quality: The quality code of the incoming value.
	timestamp: The timestamp of the incoming value as a java.util.Date
"""

	# This list will be used to create a JSON like structure that will insert rows for our styles
output_json = []
		 
		# Here we can define what styling on our rows will be.
style_orange = {"backgroundColor": "#ff9900", "fontWeight": "bold", "fontSize": 35}
style_black = {"backgroundColor": "#000000", "color": "#ff9900", "fontSize": 20}
		 
		# You could change more than just the background color, for example:
		# style_another_example {"backgroundColor": "#00AA00", "font-weight": "bold"}
		 
		 
for row in range(value.getRowCount()):
		row_object = {}
		row_value = {}
		row_style = {}
		for col in range(value.getColumnCount()):   
		    row_value[value.getColumnName(col)] = value.getValueAt(row, col)
		    row_object['value'] = row_value
		         
		        # Here we're checking the name of the column that we want to base our styling on.
		    if value.getColumnName(col) == 'Login':
		         
		            # Here we're checking for individual values within the column, and applying styling
		        if value.getValueAt(row, col) == "MROEL":
		            row_style = style_orange
		        else :
		          row_style = style_black
		                 
		    row_object['style'] = row_style
		output_json.append(row_object)
return output_json

```
