# Pass data out of subview back to originating table

**URL:** <https://forum.inductiveautomation.com/t/pass-data-out-of-subview-back-to-originating-table/37475>\
**Category:** Ignition\
**Tags:** ignition80, perspective\
**Created:** [August 6, 2020, 6:51pm UTC](https://forum.inductiveautomation.com/t/pass-data-out-of-subview-back-to-originating-table/37475 "2020-08-06T18:51:55Z")\
**Posts on this page:** 7\
**Page:** 1

<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:** [August 6, 2020, 6:51pm UTC](https://forum.inductiveautomation.com/t/pass-data-out-of-subview-back-to-originating-table/37475/1 "2020-08-06T18:51:55Z")

</div>

I have a table with some data and I have a SubView attached to each row of the table. The SubView is a very simple view with a table in it that receives an ID from the first table and does a sub-query based on whatever row is selected.

One of the values that gets queried in the SubView is a file path, which I want to pass back to the original view so users can preview a file based on the file path. I don’t know what the file path will be until a SubView is expanded and a row is selected in the SubView table.

What is the easiest way to pass a parameter out of a SubView?

---

<div class="post-metadata">

**Author:** ![code\_skin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@code\_skin](https://forum.inductiveautomation.com/u/code_skin)\
**Post date:** [August 6, 2020, 6:55pm UTC](https://forum.inductiveautomation.com/t/pass-data-out-of-subview-back-to-originating-table/37475/2 "2020-08-06T18:55:55Z")

</div>

Create a parameter on the subview and make it bidirectional. Your subview could then write the file path to the parameter to be used outside of it.

---

<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:** [August 6, 2020, 7:03pm UTC](https://forum.inductiveautomation.com/t/pass-data-out-of-subview-back-to-originating-table/37475/3 "2020-08-06T19:03:55Z")

</div>

How would I then access the bidirectional parameter from the first view (the one that houses the table with SubViews)? Would I create a parameter inside the table-\>rows-\>subview-\>viewParams object?

---

<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:** [August 6, 2020, 8:56pm UTC](https://forum.inductiveautomation.com/t/pass-data-out-of-subview-back-to-originating-table/37475/4 "2020-08-06T20:56:04Z")

</div>

I spoke with my coworker and created a message handler to pass data from the SubView back to the view.

1. Create a custom property on the view that houses the table with SubViews.
2. Deep-select your table, right-click and select `Configure Scripts...`.
3. Click `Add handler...` to add a new Message Handler. I named mine `getSelectedFilePath` and chose a `Page` scope.
4. Add this line to the script: `self.view.custom.selectedFilePath = payload['selectedFilePath']`
5. Go to the SubView. In my case, I only had a table on that view. Right-click on the table and select `Configure Events...`.
6. Choose an event handler (like `onRowClick`). Add this to the event handler: `system.perspective.sendMessage('getSelectedFilePath', payload = {'selectedFilePath': self.props.selection.data[0].filePath})`.

Every time a row is clicked, a message is sent to another view, which I used to then open a Preview window and pass in the video file path.

---

<div class="post-metadata">

**Author:** ![mmadariaga](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmadariaga/32/63201_2.png) [@mmadariaga](https://forum.inductiveautomation.com/u/mmadariaga)\
**Post date:** [December 3, 2025, 3:35pm UTC](https://forum.inductiveautomation.com/t/pass-data-out-of-subview-back-to-originating-table/37475/5 "2025-12-03T15:35:19Z")

</div>

I've been using this method, but why is it not possible to use the bidirectional/output parameter to send the data back? It seems to only work with embedded views but not on tables.

---

<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:** [December 3, 2025, 3:46pm UTC](https://forum.inductiveautomation.com/t/pass-data-out-of-subview-back-to-originating-table/37475/6 "2025-12-03T15:46:05Z")

</div>

> [@mmadariaga](#):
>
> but why

Because the row data is passed to a subview in a **single** parameter. Implementing bidirectionality on this would violate the established design principle that table edits go through an event handler to be processed, and not directly applied to `props.data`. (And I would expect the implementation to be horrifically complicated in the component, so IA just doesn't want to.)

Edit: Would also break the ability to enforce the edit control settings in `props.columns`, so probably **cannot** be implemented.

---

<div class="post-metadata">

**Author:** ![mmadariaga](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmadariaga/32/63201_2.png) [@mmadariaga](https://forum.inductiveautomation.com/u/mmadariaga)\
**Post date:** [December 4, 2025, 3:25pm UTC](https://forum.inductiveautomation.com/t/pass-data-out-of-subview-back-to-originating-table/37475/7 "2025-12-04T15:25:57Z")

</div>

Oh okay, thanks for the info!
