# How to send table row data to other view using onRowClick event of table

**URL:** <https://forum.inductiveautomation.com/t/how-to-send-table-row-data-to-other-view-using-onrowclick-event-of-table/33041>\
**Category:** General Discussion\
**Tags:** perspective\
**Created:** [March 12, 2020, 1:24pm UTC](https://forum.inductiveautomation.com/t/how-to-send-table-row-data-to-other-view-using-onrowclick-event-of-table/33041 "2020-03-12T13:24:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ptchanchal](https://avatars.discourse-cdn.com/v4/letter/p/f9ae1b/32.png) [@ptchanchal](https://forum.inductiveautomation.com/u/ptchanchal)\
**Post date:** [March 12, 2020, 1:24pm UTC](https://forum.inductiveautomation.com/t/how-to-send-table-row-data-to-other-view-using-onrowclick-event-of-table/33041/1 "2020-03-12T13:24:13Z")

</div>

I have a table which shows data from database, I want to open a pop up on clicking the row of the table with the details of that table row. How can I pass my row values to that view and how to retrieve it in that view.

Thank You.

---

<div class="post-metadata">

**Author:** ![mori.luca](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mori.luca/32/13424_2.png) [@mori.luca](https://forum.inductiveautomation.com/u/mori.luca)\
**Post date:** [March 13, 2020, 2:56pm UTC](https://forum.inductiveautomation.com/t/how-to-send-table-row-data-to-other-view-using-onrowclick-event-of-table/33041/2 "2020-03-13T14:56:52Z")

</div>

Hi @ptchanchal,  
You can see here how to pass parameter to a pop up.  
[https://docs.inductiveautomation.com/display/DOC80/Popup+Windows](https://docs.inductiveautomation.com/display/DOC80/Popup+Windows)

Once you have your parameter inside the pop up, you can perform your CRUD,  
then when you finish you may consider to use the function  
system.db.refresh()  
[https://docs.inductiveautomation.com/display/DOC79/system.db.refresh](https://docs.inductiveautomation.com/display/DOC79/system.db.refresh)  
to update your table and show up your changes.

Grab your selected row elements from the table :

> [@Using values in selected Row](http://forum.inductiveautomation.com/t/using-values-in-selected-row/6874/2):
>
> table = event.source.parent.getComponent(“Table”) selRow = table.getSelectedRow() selCol = table.getSelectedColumn() data = data.getValueAt(selRow, selCol)

If you like to pass parameters from script :

```auto
window = system.nav.openWindow('TestPopUp', {'Int' : 40})
system.nav.centerWindow(window)

```

here we are opening a pop up called "TestPopUp", passing parameter as a Dict.

---

<div class="post-metadata">

**Author:** ![ptchanchal](https://avatars.discourse-cdn.com/v4/letter/p/f9ae1b/32.png) [@ptchanchal](https://forum.inductiveautomation.com/u/ptchanchal)\
**Post date:** [March 13, 2020, 2:59pm UTC](https://forum.inductiveautomation.com/t/how-to-send-table-row-data-to-other-view-using-onrowclick-event-of-table/33041/3 "2020-03-13T14:59:50Z")

</div>

Thank you, I solved this issue by sending json file as message.

---

<div class="post-metadata">

**Author:** ![mori.luca](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mori.luca/32/13424_2.png) [@mori.luca](https://forum.inductiveautomation.com/u/mori.luca)\
**Post date:** [March 13, 2020, 3:04pm UTC](https://forum.inductiveautomation.com/t/how-to-send-table-row-data-to-other-view-using-onrowclick-event-of-table/33041/4 "2020-03-13T15:04:28Z")

</div>

If you refer at this:

> system.nav.openWindow('TestPopUp', _ **{'Int' : 40}** _ )

as

> by sending json file as message

I think this Is a Python Dictionary, otherwise I'm curious to know how you passed parameter to a window as plain JSON.

---

<div class="post-metadata">

**Author:** ![ptchanchal](https://avatars.discourse-cdn.com/v4/letter/p/f9ae1b/32.png) [@ptchanchal](https://forum.inductiveautomation.com/u/ptchanchal)\
**Post date:** [March 13, 2020, 3:11pm UTC](https://forum.inductiveautomation.com/t/how-to-send-table-row-data-to-other-view-using-onrowclick-event-of-table/33041/5 "2020-03-13T15:11:00Z")

</div>

I wrote the following code on the onRowClick event of the table:

messageType = ‘rowData’  
payload = {‘rowData’: event.value}  
scope = ‘session’  
system.perspective.sendMessage(messageType, payload, scope)

on and script configuration of label in the other view, i created a rowData message Handler and selected listen scopes as session and wrote the following code:

self.props.text = payload[‘rowData’][‘employeeName’]

---

<div class="post-metadata">

**Author:** ![mori.luca](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mori.luca/32/13424_2.png) [@mori.luca](https://forum.inductiveautomation.com/u/mori.luca)\
**Post date:** [March 13, 2020, 3:12pm UTC](https://forum.inductiveautomation.com/t/how-to-send-table-row-data-to-other-view-using-onrowclick-event-of-table/33041/6 "2020-03-13T15:12:42Z")

</div>

Oh i understand, you talking about Perspective sorry,  
never worked on it yet,  
my bad, I did’t pay attention on you tagging the post on perspective.

---

<div class="post-metadata">

**Author:** ![ptchanchal](https://avatars.discourse-cdn.com/v4/letter/p/f9ae1b/32.png) [@ptchanchal](https://forum.inductiveautomation.com/u/ptchanchal)\
**Post date:** [March 13, 2020, 3:19pm UTC](https://forum.inductiveautomation.com/t/how-to-send-table-row-data-to-other-view-using-onrowclick-event-of-table/33041/7 "2020-03-13T15:19:19Z")

</div>

thats ok, you should try perspective its good
