# Perspective table dynamic icons and rows colors

**URL:** <https://forum.inductiveautomation.com/t/perspective-table-dynamic-icons-and-rows-colors/44693>\
**Category:** Ignition\
**Tags:** perspective, ignition80\
**Created:** [March 19, 2021, 5:07pm UTC](https://forum.inductiveautomation.com/t/perspective-table-dynamic-icons-and-rows-colors/44693 "2021-03-19T17:07:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniele1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/daniele1/32/31531_2.png) [@daniele1](https://forum.inductiveautomation.com/u/daniele1)\
**Post date:** [March 19, 2021, 5:07pm UTC](https://forum.inductiveautomation.com/t/perspective-table-dynamic-icons-and-rows-colors/44693/1 "2021-03-19T17:07:37Z")

</div>

Hi,  
I want to create a table that displays for each row a description, a number binded to a tag and an icons that represent a boolean tag.  
Based on the state of the tag the icon should be visible or not and the row should change color.  
To be more specific for each row I have the name of station, the most important tag for that station and alarm bell (material/notifications) that should appear if a certain tag goes to 1.  
In this post [Icon in Perspective Table Column](http://forum.inductiveautomation.com/t/icon-in-perspective-table-column/30057/8) I saw that to include icons inside a table you should use a View and i managed to do that, the problem is that I can’t see how I can bind the ViewPath for each row. How can I do it?  
Also, is it possible to change the color of a single row as described above?  
Thanks  
Daniele

---

<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:** [March 19, 2021, 5:45pm UTC](https://forum.inductiveautomation.com/t/perspective-table-dynamic-icons-and-rows-colors/44693/2 "2021-03-19T17:45:42Z")

</div>

You’ll need to set up your data so that it contains the following structure for each row:

```auto
{
    "stationName": "MyStationOne",
    "tagPath": "[provider]SomePath/MyTag",
    "displayAlarm": "[provider]SomePath/MyTag"
}

```

In this data, the `displayAlarm` uses the same string tag path as `tagPath`, but the View itself will be responsible for determining if the icon should be shown.

You then need to set up a column configuration for each column you want in your table, and you need to make sure that the `field` property of each column configuration matches the keys in the row data.  
 ![Screen Shot 2021-03-19 at 10.38.48AM](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/2/829e5320665ce249f1a2c81e2cf518e8254b7a6f.png)

The important part is selecting that the column should render a view and supplying the path to the View (note the setting of the `render` property and the `viewPath` property):  
 ![Screen Shot 2021-03-19 at 10.39.50AM](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/0/f065fd75b0a2bf256bd501084084923beaaaf48e.png)

For changing the color of rows based on some value, please see this post: [Changing colour of row based off value in cell in perspective table - #17 by cmallonee](http://forum.inductiveautomation.com/t/changing-colour-of-row-based-off-value-in-cell-in-perspective-table/43587/17)

---

<div class="post-metadata">

**Author:** ![daniele1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/daniele1/32/31531_2.png) [@daniele1](https://forum.inductiveautomation.com/u/daniele1)\
**Post date:** [March 26, 2021, 1:19pm UTC](https://forum.inductiveautomation.com/t/perspective-table-dynamic-icons-and-rows-colors/44693/3 "2021-03-26T13:19:27Z")

</div>

Hi,  
with you method I was able to set a single icon for every row in the table, what I’m trying to achieve is to control if the icon is visibile or not for each row.  
On the left is what I have now and on the right is what i’m trying to achieve if, for example, “GRUPPO 4” and “GRUPPO 11” have an alarm going on.

 ![Perspective_Table_icon2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/0/f0125c8d3c5033ffb1f2e5b8573dd51392abeeac.png) ![Perspective_Table_icon2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/5/c56a50dda9102700ad10be79c27fe8c6b15cac82.png)  
Thanks for you help

Daniele

---

<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:** [March 26, 2021, 2:46pm UTC](https://forum.inductiveautomation.com/t/perspective-table-dynamic-icons-and-rows-colors/44693/4 "2021-03-26T14:46:47Z")

</div>

The View which is being rendered should determine if the icon is displayed or not based on the incoming data.

So the View which is being rendered should bind the path of the Icon in use to a tag binding against the tagPath being supplied as an incoming value.

 ![Screen Shot 2021-03-26 at 7.46.25AM](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/c/ac8861a72e7369dc2e58343a42815d7a5c4b8696.png)
