# My embedded icon are not showing in my table

**URL:** <https://forum.inductiveautomation.com/t/my-embedded-icon-are-not-showing-in-my-table/97925>\
**Category:** Ignition\
**Tags:** perspective, scripting\
**Created:** [October 29, 2024, 9:39pm UTC](https://forum.inductiveautomation.com/t/my-embedded-icon-are-not-showing-in-my-table/97925 "2024-10-29T21:39:03Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zied\_Brahmi](https://avatars.discourse-cdn.com/v4/letter/z/5daacb/32.png) [@Zied\_Brahmi](https://forum.inductiveautomation.com/u/Zied_Brahmi)\
**Post date:** [October 29, 2024, 9:39pm UTC](https://forum.inductiveautomation.com/t/my-embedded-icon-are-not-showing-in-my-table/97925/1 "2024-10-29T21:39:03Z")

</div>

Hello forum!,  
I have a problem embedding an icon in my ignition table.  
this is my setup for the fourth column where I want to put my icon on (sadly it's not being shown).

 ![Screenshot 2024-10-29 at 22.35.12](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/b/3bdfd0a52776df7c7170e70f31e1021b08bab965.png)  
render: view and I m putting the viewPath to my icon view  
and here is my icon view  
 ![Screenshot 2024-10-29 at 22.36.49](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/a/ba0c61a2dd47b97e1f22538772e5e3a60394f347.png)

thank you for helping me.  
another thing is that after solving this (showing the static icon on the table), I want to do a binding of the data to a dataset memory tag and to put icons dynamically (red or green), how can I do that in the transform script on the tag binding in the table please?  
Thank you.

---

<div class="post-metadata">

**Author:** ![YF129701](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yf129701/32/60498_2.png) [@YF129701](https://forum.inductiveautomation.com/u/YF129701)\
**Post date:** [October 29, 2024, 10:03pm UTC](https://forum.inductiveautomation.com/t/my-embedded-icon-are-not-showing-in-my-table/97925/2 "2024-10-29T22:03:12Z")

</div>

Are you passing in the viewPath into your Icon view as a parameter? Or did you just statically define the icon path for now, to test?

---

<div class="post-metadata">

**Author:** ![flexware](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/flexware/32/66243_2.png) [@flexware](https://forum.inductiveautomation.com/u/flexware)\
**Post date:** [October 29, 2024, 10:10pm UTC](https://forum.inductiveautomation.com/t/my-embedded-icon-are-not-showing-in-my-table/97925/3 "2024-10-29T22:10:46Z")

</div>

What does `props.data` look like? Do any of the rows of the table have an `icon` property defined? In other words, your `props.data` should look something like

```json
[
    {
        "city": "",
        "country": "",
        "population": "",
        "icon": ""
    }, ...
]

```

at the very least. In other words, you need at least one of the objects to have an `icon` key for the icon view to appear.

---

<div class="post-metadata">

**Author:** ![Zied\_Brahmi](https://avatars.discourse-cdn.com/v4/letter/z/5daacb/32.png) [@Zied\_Brahmi](https://forum.inductiveautomation.com/u/Zied_Brahmi)\
**Post date:** [October 29, 2024, 10:42pm UTC](https://forum.inductiveautomation.com/t/my-embedded-icon-are-not-showing-in-my-table/97925/4 "2024-10-29T22:42:27Z")

</div>

for now I m not passing params, I m testing statically yes

---

<div class="post-metadata">

**Author:** ![Zied\_Brahmi](https://avatars.discourse-cdn.com/v4/letter/z/5daacb/32.png) [@Zied\_Brahmi](https://forum.inductiveautomation.com/u/Zied_Brahmi)\
**Post date:** [October 29, 2024, 10:46pm UTC](https://forum.inductiveautomation.com/t/my-embedded-icon-are-not-showing-in-my-table/97925/5 "2024-10-29T22:46:27Z")

</div>

Oh! that's true, thank you!. I modified my data to include that icon and now I m seeing the icon, but the naming is ugly no? is there any way to override it?  
you seen the screenshot here

 ![Screenshot 2024-10-29 at 23.44.38](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/8/c855d1e7b4644073feae57216f451df3671a4e23.png)

and after that for the binding with the dataset (memory tag) how can I do it when transforming the dataset in the transform function ?

Thank you

---

<div class="post-metadata">

**Author:** ![flexware](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/flexware/32/66243_2.png) [@flexware](https://forum.inductiveautomation.com/u/flexware)\
**Post date:** [October 29, 2024, 10:49pm UTC](https://forum.inductiveautomation.com/t/my-embedded-icon-are-not-showing-in-my-table/97925/6 "2024-10-29T22:49:02Z")

</div>

What do you mean by "the naming is ugly"?

Also, what data does your dataset tag hold? Where does it fit into the picture? Does it hold state information from a device that you want to use in the icon column? Also, are you planning to bind the Table's `props.data` to the dataset tag?

---

<div class="post-metadata">

**Author:** ![Zied\_Brahmi](https://avatars.discourse-cdn.com/v4/letter/z/5daacb/32.png) [@Zied\_Brahmi](https://forum.inductiveautomation.com/u/Zied_Brahmi)\
**Post date:** [October 29, 2024, 11:01pm UTC](https://forum.inductiveautomation.com/t/my-embedded-icon-are-not-showing-in-my-table/97925/7 "2024-10-29T23:01:54Z")

</div>

the naming is ugly I mean in the table that I want to create for example the name will be Status not Icon and I want to show a green/ red icon there.  
and for my dataset, yes I will bind it to a memory dataset, this memory dataset will be refreshed by a gateway event script.  
After that I will bind the props.data to the dataset tag and do the transform in the following way:

```python
def transform..
dataret = []

for row in range(value.rowCount):
    row_object = {}
    asset_name = value.getValueAt(row, value.columnNames[0])

    for col in value.columnNames:
        col_obj = {}

        col_obj['value'] = value.getValueAt(row, col)
        if col == 'Status':
            #put the icon here in a good way in the dataset

    dataret.append(row_object)

return dataret

```

I hope that it's clear

---

<div class="post-metadata">

**Author:** ![flexware](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/flexware/32/66243_2.png) [@flexware](https://forum.inductiveautomation.com/u/flexware)\
**Post date:** [October 29, 2024, 11:14pm UTC](https://forum.inductiveautomation.com/t/my-embedded-icon-are-not-showing-in-my-table/97925/8 "2024-10-29T23:14:29Z")

</div>

If that's all you're wanting to do, you could do without a transform (unless I'm misunderstanding you).

Suppose your dataset tag starts with 3 columns:

```python
city | country | population

```

The first thing I would do is to add 2 more columns:

```python
city | country | population | iconPath | state

```

with the `iconPath` column holding your icon's path, and the state column holding either a text or a numeric `state` value (in your example, you only have two states - green and red, which probably corresponding to running and error/stopped).

Then, in your Icon view, you would create some view params, namely, one called `rowData` - this object gets automatically passed into your Icon view when you render a column as a view.

The `rowData` object will contain this row's data. So for instance, for row 0, the `rowData` object will be all of the fields in row 0, something like

```json
{
    "city": "",
    "country": "",
    "population": "",
    "iconPath": "material/hello",
    "state": "running"
}

```

Then, in your Icon view, you can read this `rowData.state` property and use it in a binding to set your icon's color. Similarly, you can also have a dynamic icon path, using the `rowData.iconPath` property.

The last few points I want to make is that the `iconPath` and `state` columns can be set to `visible: false` and those values still appear in the `rowData`. The last thing is that you can change the `icon` column's `header.title` property to set the column text to `Status`.

This would be much easier to show - a bit harder to type out. Let me know if you have any questions about what I said or if I'm way off!

---

<div class="post-metadata">

**Author:** ![Zied\_Brahmi](https://avatars.discourse-cdn.com/v4/letter/z/5daacb/32.png) [@Zied\_Brahmi](https://forum.inductiveautomation.com/u/Zied_Brahmi)\
**Post date:** [October 30, 2024, 12:03am UTC](https://forum.inductiveautomation.com/t/my-embedded-icon-are-not-showing-in-my-table/97925/9 "2024-10-30T00:03:11Z")

</div>

Thank you, yes good idea but I want transform to do some filtering because I also have a dropdown with the table, so in the transform I ll read the dropdown value and filter rows and I ll render the icons like you said.

Just last thing, I m not being able to change the icon header.time as you can see in the screenshot.  
Also this is somewhat off topic but I will insert many columns (10 columns) in the table and I tested that it can only show 7 columns after that it's starts to need to scroll right and left, anyway to make it really flex? and to show all columns always? Thank you.

 ![Screenshot 2024-10-30 at 01.02.19](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/6/569f32b010ee4903979d7d9f221938d67a4bc183.png)

---

<div class="post-metadata">

**Author:** ![Zied\_Brahmi](https://avatars.discourse-cdn.com/v4/letter/z/5daacb/32.png) [@Zied\_Brahmi](https://forum.inductiveautomation.com/u/Zied_Brahmi)\
**Post date:** [October 30, 2024, 12:20pm UTC](https://forum.inductiveautomation.com/t/my-embedded-icon-are-not-showing-in-my-table/97925/10 "2024-10-30T12:20:10Z")

</div>

it worked like a charm, thank you.
