# Passing Parameters to a Popup View

**URL:** <https://forum.inductiveautomation.com/t/passing-parameters-to-a-popup-view/95956>\
**Category:** Ignition\
**Created:** [September 13, 2024, 2:01pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-to-a-popup-view/95956 "2024-09-13T14:01:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aisha\_Shiddat](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@Aisha\_Shiddat](https://forum.inductiveautomation.com/u/Aisha_Shiddat)\
**Post date:** [September 13, 2024, 2:01pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-to-a-popup-view/95956/1 "2024-09-13T14:01:21Z")

</div>

I have created an event inside of a View that when a button is clicked it fires a script to input data from a form into a database table. However I need to bind and display this data to a table inside another view (popup view). I know that I have to set my input and output params, which I have done but my question is am I able to do this inside of the event in the main view? Can I use object traversal to reference the table in the other view? See attached screenshots.

 ![Event on RmView](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/a/bacbd4b9948a30bd277c25803d960d434a971d92.png)

 ![Popup_View_2024-09-13](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/0/b071901eb62ce9c2a3845ea7fbb96b1da15e5185.png)  
 ![Raw_Mat_Recieving_ 2024-09-13](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/5/e5c7c617be7bb410c59b9b72259116fdc1e1daab.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 13, 2024, 2:03pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-to-a-popup-view/95956/2 "2024-09-13T14:03:42Z")

</div>

> [@Aisha\_Shiddat](#):
>
> Can I use object traversal to reference the table in the other view?

You cannot use object traversal to access components in other views. Full stop.

---

<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 13, 2024, 2:04pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-to-a-popup-view/95956/3 "2024-09-13T14:04:23Z")

</div>

Post code, not pictures of code, so we can copy and edit it in our answers. See [Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831).

---

<div class="post-metadata">

**Author:** ![Aisha\_Shiddat](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@Aisha\_Shiddat](https://forum.inductiveautomation.com/u/Aisha_Shiddat)\
**Post date:** [September 13, 2024, 2:51pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-to-a-popup-view/95956/4 "2024-09-13T14:51:57Z")

</div>

Do you have another suggestion or example of how I could do this? Parameters should allow me to pass data in and out of views. I cannot access the other view from the property browser inside the script. So, this is why I asked about traversal.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [September 13, 2024, 2:59pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-to-a-popup-view/95956/5 "2024-09-13T14:59:08Z")

</div>

Why not bind your popup table to the database where you submitted your form data instead of populating the table with a passed parameter?

---

<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:** [September 13, 2024, 4:24pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-to-a-popup-view/95956/6 "2024-09-13T16:24:51Z")

</div>

Totally agree with this - the best paradigm that shows up all over the place in Perspective programming (esp when submitting forms) is to bind your table to a query that looks at the table you're submitting a record into (so in this example, `ShipmentDetails`).

Then, submit your form with an event like you have in your screenshots. The last part of this is to send a refresh message to your table, which will query the database and get the most up to date data - that way, you don't deal with passing large datasets between views.

For example, on line 39 in your script, you can add

```python
# use a good message handler name, obviously
system.perspective.sendMessage("RM_UpdateShipmentDetails")
# or you can use
system.perspective.sendMessage("refresh")
# if you want to refresh many components on the screen with one call

```

and then on your popup view, you can receive that message, either on the root container or the Table component itself and do something like

```python
# this assumes the message handler is defined on the Table itself
self.refreshBinding("props.data")

```

[For this to work, you need a binding on `props.data` tied to your database table.]
