# Passing Table data from a view into another view

**URL:** <https://forum.inductiveautomation.com/t/passing-table-data-from-a-view-into-another-view/61896>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [July 14, 2022, 1:11pm UTC](https://forum.inductiveautomation.com/t/passing-table-data-from-a-view-into-another-view/61896 "2022-07-14T13:11:56Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![CMuecke](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@CMuecke](https://forum.inductiveautomation.com/u/CMuecke)\
**Post date:** [July 14, 2022, 1:11pm UTC](https://forum.inductiveautomation.com/t/passing-table-data-from-a-view-into-another-view/61896/1 "2022-07-14T13:11:56Z")

</div>

I have a view called InventoryDynamicView which has 3 embedded views in it.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/c/0cc6d7be211c9c4a499be827d63bd0e677bb7739.png)

I have a table in the Inventory view.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/5/05cb2c5a941168d1b301acfbbbea77f908fcfabc.png)

I want to be able to select a Row and click the Edit button which will switch the View to the EditInventoryView.

I want the EditInventoryView to grab data that I have selected in the Table in InventoryView and pass it to the text/numeric fields in the EditInventoryView.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/6/265f0b16531a1acc0a24453a02ca5f795e346991.png)

What would be a good way to accomplish this?

---

<div class="post-metadata">

**Author:** ![craigb](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@craigb](https://forum.inductiveautomation.com/u/craigb)\
**Post date:** [July 14, 2022, 1:32pm UTC](https://forum.inductiveautomation.com/t/passing-table-data-from-a-view-into-another-view/61896/3 "2022-07-14T13:32:15Z")

</div>

If every part number is unique, in theory you only need to pass the part number and get the the rest of the info on the new page from the database.

So on your edit button, have a mouse event..

> param1 = self.getSibling("Table").custom.Selected  
> system.perspective.navigate(view = 'YOURNEWPAGE', params = {'id' : param1})

On the view your navigating to, you need to have parameters set to recieve that data.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/3/83fcee9bf4c044c512510017b6334ccefae1f103.png)

Note that I call it id, you may call it part number but either way the names have to match what's in your query to what's defined on the view.

Once you have the partnumber in the view you can do SQL to get the other values

---

<div class="post-metadata">

**Author:** ![CMuecke](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@CMuecke](https://forum.inductiveautomation.com/u/CMuecke)\
**Post date:** [July 14, 2022, 3:09pm UTC](https://forum.inductiveautomation.com/t/passing-table-data-from-a-view-into-another-view/61896/4 "2022-07-14T15:09:53Z")

</div>

I must be missing something because I can see I grabbed the PartNumber, but do not see the value update in the EditInventoryView.

---

<div class="post-metadata">

**Author:** ![craigb](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@craigb](https://forum.inductiveautomation.com/u/craigb)\
**Post date:** [July 14, 2022, 3:27pm UTC](https://forum.inductiveautomation.com/t/passing-table-data-from-a-view-into-another-view/61896/5 "2022-07-14T15:27:32Z")

</div>

I missread where you had the embedded views on the same page.

On your table view, not the embedded one but the actual view that you made that page you need a ouptut parameter.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/8/f899eca16407feb30ad152b326d41ea7552317f0.png)  
This value binds to where you get your part number from in the table.

One your view with the embedded views you will now see this value…

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/1/51021abab1e0806e371aff4a191a46b368e12f91.png)

Then on your edit view, again not the embedded one but the real one where you created that page you need a input parameter… Yours would say PartNumberIn or what ever you call it.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/2/82170b038d5d1d4d76ac1020bea018c4804f58e9.png)

Then on your embedded views you can bind the input parameter you get in the table embedded view with the output parameter in your edit embedded view.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/5/b5c86c8d816b3cda60774e8fc2938d8ebe0edb9d.png)

In my example its id, yours would be PartNumberOut for example. so in the picture your binding PartNumberIn to PartNumberOut.

Clear as mud 😀

Your have 2 options, get all the values you need from the table and pass them all as parameters, or just get the part number and use that as a sql so get the rest

```auto
Select ItemCode
From MyTable
Where PartNumber = {PartNumberIn}

```

In not sure on the exact syntax on that but that could be a named query using partnumber as a parameter.

Im not exact on this one, would need to try it out but you could use the same named query for all the results… Someone with better knowledge could correct me on this…

```auto
Select {XXX}
From MyTable
Where Partnumber = {PartNumberIn}

```

---

<div class="post-metadata">

**Author:** ![CMuecke](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@CMuecke](https://forum.inductiveautomation.com/u/CMuecke)\
**Post date:** [July 14, 2022, 5:53pm UTC](https://forum.inductiveautomation.com/t/passing-table-data-from-a-view-into-another-view/61896/6 "2022-07-14T17:53:40Z")

</div>

I got that to work. Thank you! Now the fun part.

Let’s say I have a Breakpoint container because this will be used for Desktop and Mobile configurations.

Unfortunately, the layout is different between the two. Is there a way I can reference the same parameters from the two different views?

---

<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:** [July 14, 2022, 5:55pm UTC](https://forum.inductiveautomation.com/t/passing-table-data-from-a-view-into-another-view/61896/7 "2022-07-14T17:55:23Z")

</div>

> [@CMuecke](#):
>
> Let’s say I have a Breakpoint container... Is there a way I can reference the same parameters from the two different views?

The idea of the breakpoint container is that one view will work on both devices. You wouldn't need two different views.

---

<div class="post-metadata">

**Author:** ![CMuecke](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@CMuecke](https://forum.inductiveautomation.com/u/CMuecke)\
**Post date:** [July 14, 2022, 5:59pm UTC](https://forum.inductiveautomation.com/t/passing-table-data-from-a-view-into-another-view/61896/8 "2022-07-14T17:59:02Z")

</div>

Let’s say the Desktop has the Search Bar on top and the Mobile has the Search Bar on bottom for functionality.

---

<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:** [July 14, 2022, 6:01pm UTC](https://forum.inductiveautomation.com/t/passing-table-data-from-a-view-into-another-view/61896/9 "2022-07-14T18:01:44Z")

</div>

> [@CMuecke](#):
>
> Desktop has the Search Bar on top and the Mobile has the Search Bar on bottom ...

I would try to put the search bar at the top **and** the bottom and enable one or the other based on the device type. (You'll have to study to see if there's a property you can hook this into.)

---

<div class="post-metadata">

**Author:** ![craigb](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@craigb](https://forum.inductiveautomation.com/u/craigb)\
**Post date:** [July 14, 2022, 6:47pm UTC](https://forum.inductiveautomation.com/t/passing-table-data-from-a-view-into-another-view/61896/10 "2022-07-14T18:47:31Z")

</div>

You can enable / disable things based on which view size is being used…

```auto
{view.params.size} != "small"

```

---

<div class="post-metadata">

**Author:** ![CMuecke](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@CMuecke](https://forum.inductiveautomation.com/u/CMuecke)\
**Post date:** [July 15, 2022, 11:51am UTC](https://forum.inductiveautomation.com/t/passing-table-data-from-a-view-into-another-view/61896/11 "2022-07-15T11:51:34Z")

</div>

I have found a solution. Thank you everyone!
