# Change style of cell (component Table) via script - Perspective

**URL:** <https://forum.inductiveautomation.com/t/change-style-of-cell-component-table-via-script-perspective/44573>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [March 17, 2021, 10:45am UTC](https://forum.inductiveautomation.com/t/change-style-of-cell-component-table-via-script-perspective/44573 "2021-03-17T10:45:50Z")\
**Posts on this page:** 1\
**Showing post:** 15

<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:** [October 20, 2021, 2:28pm UTC](https://forum.inductiveautomation.com/t/change-style-of-cell-component-table-via-script-perspective/44573/15 "2021-10-20T14:28:12Z")

</div>

Okay, so there's a lot to unpack here.

> [@pkhoshroo](#):
>
> as soon as I apply the cell color to that script, I get this error:  
> **setValue(): 1st arg can’t be coerced to com.inductiveautomation.ignition.common.Dataset**

This is because the data of the table is a list - not a Dataset. It's important to remember that targeted cell styling is not compatible with datasets, so you previously converted the `data` property of the table to a list of objects in order to apply styling.

You're encountering this error because you're treating your data in an inadvisable manner. I recommend only having one data source for area of data. In your current code, you're treating a `view.custom.part.spec.data` as the source for your table, but then you're treating the table as the basis for updating the view property. Try this instead:

```auto
	rowIndex=event.row # row number of the commit
	colName=event.column # column name of the commit
	newValue=event.value
    # Below, I've referenced the source-of-truth dataset instead of the "translated" props.data of the Table
	data = self.view.custom.part.spec.data # Dataset [86R ? 8C]	
	newData = system.dataset.setValue(data, rowIndex,colName,newValue)
	self.view.custom.part.spec.data = newData

```

Even this approach, however, assumes that the custom property is not a binding, which I suspect it is. If that property is the result of a binding, then you should be editing whatever source drives that binding (perhaps a query to update a SQL table).

---

_[View the full topic](https://forum.inductiveautomation.com/t/change-style-of-cell-component-table-via-script-perspective/44573)._
