# Change Perspective Table Row Color Programmatically

**URL:** <https://forum.inductiveautomation.com/t/change-perspective-table-row-color-programmatically/26453>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [July 10, 2019, 8:41pm UTC](https://forum.inductiveautomation.com/t/change-perspective-table-row-color-programmatically/26453 "2019-07-10T20:41:23Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [July 10, 2019, 9:38pm UTC](https://forum.inductiveautomation.com/t/change-perspective-table-row-color-programmatically/26453/4 "2019-07-10T21:38:30Z")

</div>

You should look at this [post](http://forum.inductiveautomation.com/t/feedback-new-perspective-table/21199/48) which describes how to configure your data to allow for what you want to do. The important part is that you will need each data element configured in the following manner (along with whatever other properties you desire):

```auto
{ 
        "value": { // The rows value. 
           "keyOne": { // Custom cell configuration.
              "value": "First Column Value"
            },
            "keyTwo": { // Custom cell configuration.
              "value": "Second Column Value"
            },
            "keyThree": { // Custom cell configuration.
              "value": "Third Column Value"
            }
        },
        "style": { // Custom row styles.
        }
    }

```

THEN in your onClick event, you’ll want to perform your logic while applying colors to the `data[rowIndex].style.backgroundColor` property.

```auto
#entirely pseudo-code
for row_index in range(len(self.props.data)):
    condition_met = data[row_index].value.keyOne == 'Color this row'
    if condition_met:
        data[row_index].style.backgroundColor = "#FFFFFF00" #desired color here

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/change-perspective-table-row-color-programmatically/26453)._
