# Data Passing Between Perspective Pages

**URL:** <https://forum.inductiveautomation.com/t/data-passing-between-perspective-pages/76088>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [July 7, 2023, 10:46pm UTC](https://forum.inductiveautomation.com/t/data-passing-between-perspective-pages/76088 "2023-07-07T22:46:33Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Colin\_Quinn](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@Colin\_Quinn](https://forum.inductiveautomation.com/u/Colin_Quinn)\
**Post date:** [July 7, 2023, 10:46pm UTC](https://forum.inductiveautomation.com/t/data-passing-between-perspective-pages/76088/1 "2023-07-07T22:46:33Z")

</div>

Hello,

I have a few pages that I am able to navigate between with buttons. When the user presses one of the buttons, it should first grab selected rows from a table on that page and format them into a list. I then need access to that list to fill out another table on the next page.

I have tried doing this a few different ways without much luck.

The first being `self.session.custom` variables which I have verified are updating properly within the designer, but cannot seem to get it working on a browser instance. For the table on the second screen, I set up a binding to that same variable, but the table data comes up empty.

The second being view parameters with `system.perspective.navigate` and using the `params` flag to pass the object through. I populated the parameter as such:

```auto
selected = []
for row in tableData:
		# add row to new table
		if row.value.selected == True:
			selected.append(row.value)

	system.perspective.navigate('view2', params = {'view2Param': selected})

```

where `view2Param` is the parameter key on the targeted view.

Are there any other ways to do this or am I missing something probably obvious? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [July 7, 2023, 10:49pm UTC](https://forum.inductiveautomation.com/t/data-passing-between-perspective-pages/76088/2 "2023-07-07T22:49:06Z")

</div>

Have you tried message handlers?  
[https://docs.inductiveautomation.com/display/DOC81/Component+Message+Handlers](https://docs.inductiveautomation.com/display/DOC81/Component+Message+Handlers)

---

<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:** [July 8, 2023, 1:08am UTC](https://forum.inductiveautomation.com/t/data-passing-between-perspective-pages/76088/3 "2023-07-08T01:08:46Z")

</div>

Message handlers won't work when you're changing pages

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [July 8, 2023, 1:09am UTC](https://forum.inductiveautomation.com/t/data-passing-between-perspective-pages/76088/4 "2023-07-08T01:09:05Z")

</div>

> [@Colin\_Quinn](#):
>
> The first being `self.session.custom` variables which I have verified are updating properly within the designer, but cannot seem to get it working on a browser instance.

This is the best way to go about this, so your first consideration should be determining why you're having trouble getting it to work in a Session. Provide the code which does the write to the property, and show us the binding for the Table on the second page.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [July 8, 2023, 1:11am UTC](https://forum.inductiveautomation.com/t/data-passing-between-perspective-pages/76088/5 "2023-07-08T01:11:51Z")

</div>

Now let's take a look at your code... It _looks_ like a copy/paste issue, but the formatting is all wrong here. If it's just a pasting issue you can ignore this, but it looks like the supplied code would navigate after checking the 0th row in the table, whether that row is selected or not, and would not check any other rows.

> [@Colin\_Quinn](#):
>
> ```auto
> selected = []
> for row in tableData:
> # add row to new table
> if row.value.selected == True:
> selected.append(row.value)
> 
> system.perspective.navigate('view2', params = {'view2Param': selected})
> 
> ```

It should have this indentation:

```auto
for row in tableData:
	# add row to new table
	if row.value.selected: # check against a boolean value is redundant if row.value.selected is itself a boolean
	    selected.append(row.value)

system.perspective.navigate('view2', params = {'view2Param': selected})

```

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [July 8, 2023, 1:27am UTC](https://forum.inductiveautomation.com/t/data-passing-between-perspective-pages/76088/6 "2023-07-08T01:27:20Z")

</div>

You are right of course, i was mistakenly thinking about page scoped messages between views.

---

<div class="post-metadata">

**Author:** ![Colin\_Quinn](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@Colin\_Quinn](https://forum.inductiveautomation.com/u/Colin_Quinn)\
**Post date:** [July 9, 2023, 12:19am UTC](https://forum.inductiveautomation.com/t/data-passing-between-perspective-pages/76088/7 "2023-07-09T00:19:30Z")

</div>

@cmallonee You're right on the second code snippet being a copy/paste issue. I fill out that `selected` list and _then_ call `system.perspective.navigate`.

I agree that session variables seem the best way, but have had trouble debugging them. Is there a way to view the data held in them is the browser/session? Here's my technique for populating my session variable.

```auto
#clear previous selections
	self.session.custom.selectedDataTable= []	
	tableData = self.getSibling("tblResults").props.data
	
	for row in tableData:
		if row.value.selected == True:
# when we hit a selected row, append to session variable
			self.session.custom.selectedDataTable.append(row.value)
	
	system.perspective.navigate('/view)

```

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

**It was as this point where I went for screenshots of a web session testing it, and it worked... I guess inquiring about it is the real solution. Thanks for the help!**

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [July 9, 2023, 6:57am UTC](https://forum.inductiveautomation.com/t/data-passing-between-perspective-pages/76088/8 "2023-07-09T06:57:19Z")

</div>

I usually add a 'debug' button that `system.perspective.print` things, so I can see whatever I want in the browser console.

Quick thing about the code snippet presented here: Don't compare booleans to `True` or `False`. They're already `True` or `False`. Comparing them only results in... a boolean, which they already are.  
`if row.value.selected:` is enough, and if the boolean's name is well chosen, it makes the condition read like english: "if something.selected" is very clear.

Note also that you could replace the explicit loop with a comprehension:  
`filtered_data = [row.value for row in tableData if row.value.selected]`

> [@cmallonee](#):
>
> This is the best way to go about this

Really ? I'd naturally tend to take the view params route for this kind of use cases.  
I'm not a huge fan of putting everything in session props, especially when they're used in just one page.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [July 9, 2023, 3:14pm UTC](https://forum.inductiveautomation.com/t/data-passing-between-perspective-pages/76088/9 "2023-07-09T15:14:05Z")

</div>

> [@pascal.fragnoud](#):
>
> Really ? I'd naturally tend to take the view params route for this kind of use cases.

The title is _passing data between pages_, which I had originally interpreted as two pages sharing data at the same time while both are open. If one page is open, and the intent is to navigate to a second page with some set of data, then yes, param passing is the way to go.

---

<div class="post-metadata">

**Author:** ![rod.rebman](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@rod.rebman](https://forum.inductiveautomation.com/u/rod.rebman)\
**Post date:** [December 5, 2023, 9:15pm UTC](https://forum.inductiveautomation.com/t/data-passing-between-perspective-pages/76088/10 "2023-12-05T21:15:28Z")

</div>

Was there any issues with this approach in certain versions? I'm working on a v8.1.18 gateway and have a programmer on v8.1.31, unable to get this to function with:

```auto
system.perspective.navigate(view = 'myView', params = {'myKey': 'myValue'})

```

I was able to pass between views using a session scoped custom parameter, but our initial thought was to use View parameters as the app navigates views within the same page. The key within the script was matched to the view parameter on 'myView'.

---

<div class="post-metadata">

**Author:** ![ARIFRAHUMAN\_A](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@ARIFRAHUMAN\_A](https://forum.inductiveautomation.com/u/ARIFRAHUMAN_A)\
**Post date:** [May 29, 2025, 8:34am UTC](https://forum.inductiveautomation.com/t/data-passing-between-perspective-pages/76088/11 "2025-05-29T08:34:54Z")

</div>

In my project, I used an icon and added a context menu to it. In the context menu, I selected the **Link** type and set the page URL and target as required. However, I was not able to pass parameters through the link. I need to pass parameters to that page when it's opened can anyone please help?
