# Changing table row based on conditional statement

**URL:** <https://forum.inductiveautomation.com/t/changing-table-row-based-on-conditional-statement/64071>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [September 14, 2022, 6:12pm UTC](https://forum.inductiveautomation.com/t/changing-table-row-based-on-conditional-statement/64071 "2022-09-14T18:12:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maryam\_Nassar](https://avatars.discourse-cdn.com/v4/letter/m/90db22/32.png) [@Maryam\_Nassar](https://forum.inductiveautomation.com/u/Maryam_Nassar)\
**Post date:** [September 14, 2022, 6:12pm UTC](https://forum.inductiveautomation.com/t/changing-table-row-based-on-conditional-statement/64071/1 "2022-09-14T18:12:57Z")

</div>

Hello, I am using a table in Ignition Designer and am looking for a way to change each individual row of the table based on a condition from an external source. The concept is pretty simple, if the value of the external source is 1, the row should be green, if its 0, the row should be red. Through the table properties, I have seen how to change all the rows to a single color. But no way to add logic to control the color of each individual row. Does anyone have an idea on how to do this? Thanks

---

<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:** [September 14, 2022, 6:30pm UTC](https://forum.inductiveautomation.com/t/changing-table-row-based-on-conditional-statement/64071/2 "2022-09-14T18:30:01Z")

</div>

Very important: _Perspective_ or _Vision_?  
Please use the edit button (pencil icon) below your post and add the appropriate tag.  
Thanks, and welcome to the forum.

---

<div class="post-metadata">

**Author:** ![Maryam\_Nassar](https://avatars.discourse-cdn.com/v4/letter/m/90db22/32.png) [@Maryam\_Nassar](https://forum.inductiveautomation.com/u/Maryam_Nassar)\
**Post date:** [September 14, 2022, 6:39pm UTC](https://forum.inductiveautomation.com/t/changing-table-row-based-on-conditional-statement/64071/3 "2022-09-14T18:39:23Z")

</div>

Perspective, thanks

---

<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:** [September 14, 2022, 8:53pm UTC](https://forum.inductiveautomation.com/t/changing-table-row-based-on-conditional-statement/64071/4 "2022-09-14T20:53:36Z")

</div>

Have a look at the data structure of the default data in the table component. In particular look at the data structure for the _Folsom_ cell which is coloured orange. You’ll see that the simple value is replaced by a dictionary of which one element is the value and others include the style.

Most of us will generate the dataset from a single SQL query and then use a script transform in the binding to apply styles as required.
