# Open popup on table cell click

**URL:** <https://forum.inductiveautomation.com/t/open-popup-on-table-cell-click/29820>\
**Category:** Ignition\
**Created:** [November 10, 2019, 7:45am UTC](https://forum.inductiveautomation.com/t/open-popup-on-table-cell-click/29820 "2019-11-10T07:45:40Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bob\_O](https://avatars.discourse-cdn.com/v4/letter/b/5e9695/32.png) [@Bob\_O](https://forum.inductiveautomation.com/u/Bob_O)\
**Post date:** [November 10, 2019, 7:45am UTC](https://forum.inductiveautomation.com/t/open-popup-on-table-cell-click/29820/1 "2019-11-10T07:45:40Z")

</div>

I have a table and depending on which cell is click on, I would like a certain popup to open. I “think” this would use an if then but I can’t get the syntax correct and I get errors. I do have the below and no matter which cell is click, it opens the popup which doesn’t surprise me because I know I have something incorrect.

So in this example if I click the cell in row 3 and column 2 then I would like Test 1 popup to open but if say I click the cell in row 1 and column 1 nothing would popup in this case.

(event.source.selectedRow==3 and event.source.selectedColumn==2)  
system.nav.swapTo(“Fueling Site/Test 1 Popup”)

Thanks for any pointers!

---

<div class="post-metadata">

**Author:** ![Bob\_O](https://avatars.discourse-cdn.com/v4/letter/b/5e9695/32.png) [@Bob\_O](https://forum.inductiveautomation.com/u/Bob_O)\
**Post date:** [November 10, 2019, 8:59am UTC](https://forum.inductiveautomation.com/t/open-popup-on-table-cell-click/29820/2 "2019-11-10T08:59:45Z")

</div>

I’ve made progress. Amazing what watch their videos can do!

Thanks,

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [November 10, 2019, 9:08am UTC](https://forum.inductiveautomation.com/t/open-popup-on-table-cell-click/29820/3 "2019-11-10T09:08:49Z")

</div>

> [@Bob\_O](#):
>
> I’ve made progress

I'm not sure how to quantify "progress", but you can use this:

```auto
if (event.source.selectedRow==3 and event.source.selectedColumn==2):
	system.nav.swapTo(“Fueling Site/Test 1 Popup”)

```

Also, it's best if you briefly describe your issue in the topic title, as opposed to something generic like "I need help". And if you manage to solve your issue, providing the solution for others who may have the same issue in years to come 🙂

---

<div class="post-metadata">

**Author:** ![Bob\_O](https://avatars.discourse-cdn.com/v4/letter/b/5e9695/32.png) [@Bob\_O](https://forum.inductiveautomation.com/u/Bob_O)\
**Post date:** [November 10, 2019, 9:42am UTC](https://forum.inductiveautomation.com/t/open-popup-on-table-cell-click/29820/4 "2019-11-10T09:42:01Z")

</div>

The main issues were the **:**

if (event.source.selectedRow==3 and event.source.selectedColumn==2) **:**

and then the

**TAB/Indent** system.nav.swapTo(“Fueling Site/Test 1 Popup”)

Hope that made sense and thanks for the reply!

Edit…Here is the video that helped me.

[https://inductiveuniversity.com/videos/control-flow-logic/7.9](https://inductiveuniversity.com/videos/control-flow-logic/7.9)

---

<div class="post-metadata">

**Author:** ![tordvd](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tordvd/32/11525_2.png) [@tordvd](https://forum.inductiveautomation.com/u/tordvd)\
**Post date:** [November 10, 2019, 10:02am UTC](https://forum.inductiveautomation.com/t/open-popup-on-table-cell-click/29820/5 "2019-11-10T10:02:17Z")

</div>

There exist a scripting function when clicking a cell. I think “OnCellClick”. Use that function to map your click

---

<div class="post-metadata">

**Author:** ![Bob\_O](https://avatars.discourse-cdn.com/v4/letter/b/5e9695/32.png) [@Bob\_O](https://forum.inductiveautomation.com/u/Bob_O)\
**Post date:** [November 10, 2019, 10:27am UTC](https://forum.inductiveautomation.com/t/open-popup-on-table-cell-click/29820/6 "2019-11-10T10:27:29Z")

</div>

Thank you tordvd. I’ll have to search that.

---

<div class="post-metadata">

**Author:** ![fleclerc](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/fleclerc/32/20480_2.png) [@fleclerc](https://forum.inductiveautomation.com/u/fleclerc)\
**Post date:** [January 6, 2021, 9:55pm UTC](https://forum.inductiveautomation.com/t/open-popup-on-table-cell-click/29820/7 "2021-01-06T21:55:09Z")

</div>

In a table, I have a column rendered as a view to show a button. Clicking on it opens a popup with more details. It didnt worked well at first, but it does now with release 8.1.1.

[“Selected rows within a Table Component no longer prevents click events to views rendered within the Table.”](https://inductiveautomation.com/downloads/releasenotes/8.1.1)

Using OnCellClick is a good way if you want to display the values instead of a button like me.

---

<div class="post-metadata">

**Author:** ![Casu](https://avatars.discourse-cdn.com/v4/letter/c/49beb7/32.png) [@Casu](https://forum.inductiveautomation.com/u/Casu)\
**Post date:** [March 31, 2022, 2:22am UTC](https://forum.inductiveautomation.com/t/open-popup-on-table-cell-click/29820/8 "2022-03-31T02:22:44Z")

</div>

For using the OnCellClick, is there a way to push the actual cell data into usable info for the popup?  
e.g. my table has rows with numbers 1-5. When someone clicks onto these rows, popups 1, 2 etc would open when clicking onto the respective numbers.

Is there a way to push those numbers onto the popup configuration? I can browse properties but am not sure how to refer to a specific row of data, even using the props.selection.selectedRow, which gives you the selected items row number.

---

<div class="post-metadata">

**Author:** ![Casu](https://avatars.discourse-cdn.com/v4/letter/c/49beb7/32.png) [@Casu](https://forum.inductiveautomation.com/u/Casu)\
**Post date:** [March 31, 2022, 3:24am UTC](https://forum.inductiveautomation.com/t/open-popup-on-table-cell-click/29820/9 "2022-03-31T03:24:35Z")

</div>

Update: I’ve changed to using a script instead and it has successfully pushed through on click. However, for some reason, my parameter is not getting input and the default value has been taken instead. I had written the following:

system.perspective.openPopup(“PopupID”, ‘folder/folder/popup’, params = {‘parameter’: event.value })

Where the event.value is the row value from the table. It is logged as a JSON object, not sure if that affecs it.
