# Perspective table selection data issue

**URL:** <https://forum.inductiveautomation.com/t/perspective-table-selection-data-issue/106428>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [May 19, 2025, 7:19pm UTC](https://forum.inductiveautomation.com/t/perspective-table-selection-data-issue/106428 "2025-05-19T19:19:50Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rickard.eriksson](https://avatars.discourse-cdn.com/v4/letter/r/7cd45c/32.png) [@rickard.eriksson](https://forum.inductiveautomation.com/u/rickard.eriksson)\
**Post date:** [May 19, 2025, 7:19pm UTC](https://forum.inductiveautomation.com/t/perspective-table-selection-data-issue/106428/1 "2025-05-19T19:19:50Z")

</div>

Hi,

I'm having some troubles with a perspective table that is styled based on row.

When i select a row, the data returns correctly in props.selection.data[0]:

```python
{
  "DocEntry": 79,
  "LineNum": 15,
  "PlannedQty": 693.6,
  "IssuedQty": 693.6,
  "BaseQty": 0.24605,
  "IssueType": "M",
  "ItmsGrpCod": 101,
  "VisOrder": 1,
  "Balance": null,
  "ItemCode": "2009",
  "UomEntry": -1,
  "ItemName": "C",
  "UomCode": "Manual",
  "ItemType": 4,
  "StartDate": 1746550800000,
  "EndDate": 1746982800000,
  "BaseQtyNum": 0.003468,
  "Status": "P",
  "UpdateDate": 1747682210147,
  "Operator": "admin",
  "json_data": "[{\"batchno\":\"batfch\",\"amount\":1},{\"batchno\":\"asdasd\",\"amount\":32}]",
  "OrderItemStatus": "Preparing",
  "column_40": "",
  "column_41": "",
  "column_42": "",
  "column_47": "",
  "column_48": "",
  "column_49": "",
  "column_43": "",
  "column_44": "",
  "column_45": "",
  "column_46": "",
  "column_50": "",
  "column_29": "",
  "column_25": "",
  "column_26": "",
  "column_27": "",
  "column_28": "",
  "column_23": "",
  "column_24": "",
  "column_30": "",
  "column_31": "",
  "column_36": "",
  "column_37": "",
  "column_38": "",
  "column_39": "",
  "column_32": "",
  "column_33": "",
  "column_34": "",
  "column_35": ""
}

```

But when i refresh the binding I _sometimes_ get the 'style' as an object in the array:

```python
{
  "DocEntry": {
    "style": {
      "backgroundColor": "#FCBF49"
    },
    "value": 79
  },
  "LineNum": {
    "style": {
      "backgroundColor": "#FCBF49"
    },
    "value": 15
  },
  "PlannedQty": {
    "style": {
      "backgroundColor": "#FCBF49"
    },
    "value": 693.6
  },
  "IssuedQty": {
    "style": {
      "backgroundColor": "#FCBF49"
    },
    "value": 693.6
  },
  "BaseQty": {
    "style": {
      "backgroundColor": "#FCBF49"
    },
    "value": 0.24605
  },
  "IssueType": {
    "style": {
      "backgroundColor": "#FCBF49"
    },
    "value": "M"
  },
  "ItmsGrpCod": {
    "style": {
      "backgroundColor": "#FCBF49"
    },
    "value": 101
  },
  "VisOrder": {
    "style": {
      "backgroundColor": "#FCBF49"
    },
    "value": 1
  },
  "Balance": {
    "style": {
      "backgroundColor": "#FCBF49"
    },
    "value": null
  },
  "ItemCode": {
    "style": {
      "backgroundColor": "#FCBF49"
    },
    "value": "200019"
  },
  "UomEntry": {
    "style": {
      "backgroundColor": "#FCBF49"
    },
    "value": -1
  },
  "ItemName": {
    "style": {
      "backgroundColor": "#FCBF49"
    },
    "value": "C"
  },
  "UomCode": {
    "style": {
      "backgroundColor": "#FCBF49"
    },
    "value": "Manual"
  },
  "ItemType": {
    "style": {
      "backgroundColor": "#FCBF49"
    },
    "value": 4
  },
  "StartDate": {
    "style": {
      "backgroundColor": "#FCBF49"
    },
    "value": 1746550800000
  },
  "EndDate": {
    "style": {
      "backgroundColor": "#FCBF49"
    },
    "value": 1746982800000
  },
  "BaseQtyNum": {
    "style": {
      "backgroundColor": "#FCBF49"
    },
    "value": 0.003468
  },
  "Status": {
    "style": {
      "backgroundColor": "#FCBF49"
    },
    "value": "P"
  },
  "UpdateDate": {
    "style": {
      "backgroundColor": "#FCBF49"
    },
    "value": 1747682210147
  },
  "Operator": {
    "style": {
      "backgroundColor": "#FCBF49"
    },
    "value": "admin"
  },
  "json_data": {
    "style": {
      "backgroundColor": "#FCBF49"
    },
    "value": "[{\"batchno\":\"batfch\",\"amount\":1},{\"batchno\":\"asdasd\",\"amount\":32}]"
  },
  "OrderItemStatus": {
    "style": {
      "backgroundColor": "#FCBF49"
    },
    "value": "Preparing"
  }
}

```

---

<div class="post-metadata">

**Author:** ![Benjamin\_Furlani](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/benjamin_furlani/32/66084_2.png) [@Benjamin\_Furlani](https://forum.inductiveautomation.com/u/Benjamin_Furlani)\
**Post date:** [May 19, 2025, 7:38pm UTC](https://forum.inductiveautomation.com/t/perspective-table-selection-data-issue/106428/2 "2025-05-19T19:38:02Z")

</div>

Can you show your binding?

---

<div class="post-metadata">

**Author:** ![rickard.eriksson](https://avatars.discourse-cdn.com/v4/letter/r/7cd45c/32.png) [@rickard.eriksson](https://forum.inductiveautomation.com/u/rickard.eriksson)\
**Post date:** [May 19, 2025, 8:35pm UTC](https://forum.inductiveautomation.com/t/perspective-table-selection-data-issue/106428/3 "2025-05-19T20:35:57Z")

</div>

Variable:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/5/d5583445fb2e5cfa09fd23f057523e8cdc7aa72a.png)

Table:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/7/f7e1c3159debf436424ad7896bdbabc1f472704d.png)

Transform script from the ignition documentation:

```python
def transform(self, value, quality, timestamp):
    data = []
    for row in value: # Loop over each row.
        keys = row.keys() # Determine the keys in use for the row.
        if row["OrderItemStatus"] == 'Prepared' : # If the population in THIS row is more than 1000000...
            style = {"backgroundColor": "#5bde6a"} # the style should be this.
        elif row["OrderItemStatus"] == 'Preparing':
        	style = {"backgroundColor": "#FCBF49"} 
        else:
            style = {"backgroundColor": ""} # Otherwise, the style should be this.
            
        # This next line builds an object/dictionary which contains value and style keys for 
        # every cell in the row. The value key will be used to store the true value of the 
        # object, while the style key will be used to define the appearance of the CELL. 
        # Since our goal is to style all cells in this row in the same manner, we are re-using 
        # the same style value across all cells in this row.
        formatted_rows = [{"value": v, "style": style} for v in row.values()]
        
        # Here, we make a proper python dictionary out of the known keys
        # and our formatted cells.
        row_dict = dict(zip(keys, formatted_rows))
        data.append(row_dict) # Now append this new dictionary to our new data array/list.
    return data # Finally, return our newly formatted data.

```

---

<div class="post-metadata">

**Author:** ![Cose\_Peter1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cose_peter1/32/79174_2.png) [@Cose\_Peter1](https://forum.inductiveautomation.com/u/Cose_Peter1)\
**Post date:** [March 18, 2026, 7:09am UTC](https://forum.inductiveautomation.com/t/perspective-table-selection-data-issue/106428/4 "2026-03-18T07:09:07Z")

</div>

I have the same issue. Were you able to fix it?

---

<div class="post-metadata">

**Author:** ![rickard.eriksson](https://avatars.discourse-cdn.com/v4/letter/r/7cd45c/32.png) [@rickard.eriksson](https://forum.inductiveautomation.com/u/rickard.eriksson)\
**Post date:** [March 18, 2026, 11:30pm UTC](https://forum.inductiveautomation.com/t/perspective-table-selection-data-issue/106428/5 "2026-03-18T23:30:51Z")

</div>

No

---

<div class="post-metadata">

**Author:** ![Matthew\_Automation](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@Matthew\_Automation](https://forum.inductiveautomation.com/u/Matthew_Automation)\
**Post date:** [March 19, 2026, 12:23pm UTC](https://forum.inductiveautomation.com/t/perspective-table-selection-data-issue/106428/6 "2026-03-19T12:23:35Z")

</div>

Can I ask, if you want all the rows to be styled the same, why are you putting a style binding in the row transform? Based on the binding, I would expect style to show up in the data always.

Not sure if I will be able to help. Could you explain the _sometimes_, what conditions lead to it adding style, and what dont? I would be tempted to add a logger and see if the transform is running on basic selections, or only on the refresh bindings.

---

<div class="post-metadata">

**Author:** ![rickard.eriksson](https://avatars.discourse-cdn.com/v4/letter/r/7cd45c/32.png) [@rickard.eriksson](https://forum.inductiveautomation.com/u/rickard.eriksson)\
**Post date:** [March 19, 2026, 9:45pm UTC](https://forum.inductiveautomation.com/t/perspective-table-selection-data-issue/106428/7 "2026-03-19T21:45:57Z")

</div>

Hi, I dont want all rows to be styled the same:

The sometimes is just random. Selected the same row with the same data gives different results at different points in time.

```python
    if row["OrderItemStatus"] == 'Prepared' : # If the population in THIS row is more than 1000000...
            style = {"backgroundColor": "#5bde6a"} # the style should be this.
        elif row["OrderItemStatus"] == 'Preparing':
        	style = {"backgroundColor": "#FCBF49"} 
        else:
            style = {"backgroundColor": ""} 

```

---

<div class="post-metadata">

**Author:** ![Matthew\_Automation](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@Matthew\_Automation](https://forum.inductiveautomation.com/u/Matthew_Automation)\
**Post date:** [March 20, 2026, 12:24pm UTC](https://forum.inductiveautomation.com/t/perspective-table-selection-data-issue/106428/8 "2026-03-20T12:24:16Z")

</div>

Oh whoops, I had looked through the json and they all had the same background color assigned, so I thought that was the goal.

---

<div class="post-metadata">

**Author:** ![Cose\_Peter1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cose_peter1/32/79174_2.png) [@Cose\_Peter1](https://forum.inductiveautomation.com/u/Cose_Peter1)\
**Post date:** [April 6, 2026, 1:27pm UTC](https://forum.inductiveautomation.com/t/perspective-table-selection-data-issue/106428/9 "2026-04-06T13:27:14Z")

</div>

For me, this only seems to happen when the query binding has polling turned on and the styling for the background color is dynamically set for a row or cell using a script transform, but I'm able to consistently reproduce this.
