# Icon in Perspective Table Column

**URL:** <https://forum.inductiveautomation.com/t/icon-in-perspective-table-column/30057>\
**Category:** Ignition Early Access\
**Created:** [November 18, 2019, 6:35pm UTC](https://forum.inductiveautomation.com/t/icon-in-perspective-table-column/30057 "2019-11-18T18:35:47Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![bharghavi.balagopal](https://avatars.discourse-cdn.com/v4/letter/b/8dc957/32.png) [@bharghavi.balagopal](https://forum.inductiveautomation.com/u/bharghavi.balagopal)\
**Post date:** [November 18, 2019, 6:35pm UTC](https://forum.inductiveautomation.com/t/icon-in-perspective-table-column/30057/1 "2019-11-18T18:35:47Z")

</div>

Hello,

Is there a way I can show an icon in a column. ?  
Like map the values of a column with some icons, how can it be done?

Thanks,  
Bharghavi

---

<div class="post-metadata">

**Author:** ![jdonohue](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@jdonohue](https://forum.inductiveautomation.com/u/jdonohue)\
**Post date:** [February 11, 2020, 3:53pm UTC](https://forum.inductiveautomation.com/t/icon-in-perspective-table-column/30057/2 "2020-02-11T15:53:48Z")

</div>

Bump this - I’m also curious to know if there’s a way to add icons to tables in perspective. Uploading a sample.

 ![examples](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/56358befd34eaa99bb22ce6f11e5cf1903ce72fc.png) Is there a way to achieve this?

---

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [February 11, 2020, 3:55pm UTC](https://forum.inductiveautomation.com/t/icon-in-perspective-table-column/30057/3 "2020-02-11T15:55:34Z")

</div>

Make the column render a view that has the icon.

---

<div class="post-metadata">

**Author:** ![jdonohue](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@jdonohue](https://forum.inductiveautomation.com/u/jdonohue)\
**Post date:** [February 11, 2020, 5:22pm UTC](https://forum.inductiveautomation.com/t/icon-in-perspective-table-column/30057/4 "2020-02-11T17:22:30Z")

</div>

thanks @jpark. I’ve done a “subview” in a table but haven’t directly put another view in there. Do you know of any reference material?

---

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [February 11, 2020, 5:29pm UTC](https://forum.inductiveautomation.com/t/icon-in-perspective-table-column/30057/5 "2020-02-11T17:29:22Z")

</div>

[https://docs.inductiveautomation.com/display/DOC80/Perspective+-+Table](https://docs.inductiveautomation.com/display/DOC80/Perspective+-+Table)  
You’ll start there.

You’ll make use of onSubviewExpand and collapse. You’ll point the view at another view and maybe feed it a param.

Then head here

[https://docs.inductiveautomation.com/display/DOC80/Displaying+a+SubView+in+a+Table](https://docs.inductiveautomation.com/display/DOC80/Displaying+a+SubView+in+a+Table)

---

<div class="post-metadata">

**Author:** ![jdonohue](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@jdonohue](https://forum.inductiveautomation.com/u/jdonohue)\
**Post date:** [February 11, 2020, 5:42pm UTC](https://forum.inductiveautomation.com/t/icon-in-perspective-table-column/30057/6 "2020-02-11T17:42:24Z")

</div>

Hi @wking - thanks for the links. What I’m looking to do is embed a view in the table (not a subview). In the table video, it does mention this functionality at **2:49** in the perspective table video [https://inductiveuniversity.com/video/perspective-table/8.0/8.0](https://inductiveuniversity.com/video/perspective-table/8.0/8.0). I believe there’s a key word I need to have in a object. I tried “view” but it didn’t work.

---

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [February 11, 2020, 5:46pm UTC](https://forum.inductiveautomation.com/t/icon-in-perspective-table-column/30057/7 "2020-02-11T17:46:19Z")

</div>

Ahh…So like a highlighted link that maybe calls and opens a pop-up or even switches the view or something?

I am trying to figure this functionality out myself as well.

So I’ll follow:

---

<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:** [February 11, 2020, 5:46pm UTC](https://forum.inductiveautomation.com/t/icon-in-perspective-table-column/30057/8 "2020-02-11T17:46:24Z")

</div>

No, @wking, that’s not what @jpark is recommending.

@jdonohue:

1. Create a View which has just an icon, and bind the icon path to be dependent on some value supplied as a View param.
2. You should include a new `props.column` config which has `render` set to “view”.
3. set the relevant column configuration’s `viewPath` property to the path of the View which you set up with the Icon.
4. supply `columns[x].viewParams` with the value which will determine the icon to be used.

---

<div class="post-metadata">

**Author:** ![jdonohue](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@jdonohue](https://forum.inductiveautomation.com/u/jdonohue)\
**Post date:** [February 11, 2020, 6:21pm UTC](https://forum.inductiveautomation.com/t/icon-in-perspective-table-column/30057/9 "2020-02-11T18:21:36Z")

</div>

@cmallonee thank you so much for the help. I think I’m one step away from solving this. I’ve attached some screenshots of the instructions above.

- created iconView with view params binded to the icon.
- created query to populate table.
- created table view with table component in it. Binded to the query.
- added second column to table. selected viewPath to be iconView created and set viewParams.

Still not able to show up, but feel like I’m close!

 ![table%201%20-%20view%20icon](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/649275e7ff97bd6fc8325fd8caec0395c27c0d61.png) ![table%202%20-%20test%20query](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/ed62f7acb40f7317262ff96e0b59de5c0d65e89b.png) ![table%203%20-%20table](https://us1.discourse-cdn.com/inductiveautomation/original/2X/1/196faf04a89aea4947da209e65a2f5b5639105ef.png)

---

<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:** [February 11, 2020, 6:37pm UTC](https://forum.inductiveautomation.com/t/icon-in-perspective-table-column/30057/10 "2020-02-11T18:37:08Z")

</div>

Your `data` object is one-dimensional, so the column won’t display any data because there is nothing to display.

1. Provide a second column in your dataset.
2. Set `columns[1].field` to the value of the dataset’s second column.

Table’s will not just display a configured column with manufactured data - they must reference a data object “column”.

---

<div class="post-metadata">

**Author:** ![jdonohue](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@jdonohue](https://forum.inductiveautomation.com/u/jdonohue)\
**Post date:** [February 11, 2020, 6:40pm UTC](https://forum.inductiveautomation.com/t/icon-in-perspective-table-column/30057/11 "2020-02-11T18:40:41Z")

</div>

PERFECT! Thank you @cmallonee @jpark for the help!

---

<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:** [February 11, 2020, 6:42pm UTC](https://forum.inductiveautomation.com/t/icon-in-perspective-table-column/30057/12 "2020-02-11T18:42:30Z")

</div>

You’re welcome.

What you might want to do instead of passing the icon path is just pass a simple value (`true`, `false`, or a numeric value) and then let the View with the icon determine the icon path from the value.

---

<div class="post-metadata">

**Author:** ![dkyerger](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkyerger/32/7423_2.png) [@dkyerger](https://forum.inductiveautomation.com/u/dkyerger)\
**Post date:** [January 22, 2021, 2:44am UTC](https://forum.inductiveautomation.com/t/icon-in-perspective-table-column/30057/13 "2021-01-22T02:44:28Z")

</div>

Sorry about digging up an old topic, but I was wondering if there is a way to pass the current value for the column (aka for that row) into the view to have it display different icons based on the value in the table.

---

<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:** [January 22, 2021, 3:59pm UTC](https://forum.inductiveautomation.com/t/icon-in-perspective-table-column/30057/14 "2021-01-22T15:59:48Z")

</div>

The subview to be rendered should accept a param of type object with a key of `value`. This param will receive all of the row values, so you would bind against `self.view.params.value.targetParam`. See the docs [here](https://docs.inductiveautomation.com/display/DOC81/Displaying+a+SubView+in+a+Table) and look specifically at step number 6.
