# Pass Parameter between pages

**URL:** <https://forum.inductiveautomation.com/t/pass-parameter-between-pages/21108>\
**Category:** Ignition Early Access\
**Tags:** ignition80\
**Created:** [November 28, 2018, 11:10am UTC](https://forum.inductiveautomation.com/t/pass-parameter-between-pages/21108 "2018-11-28T11:10:38Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![oisin.gribben](https://avatars.discourse-cdn.com/v4/letter/o/9d8465/32.png) [@oisin.gribben](https://forum.inductiveautomation.com/u/oisin.gribben)\
**Post date:** [November 28, 2018, 11:10am UTC](https://forum.inductiveautomation.com/t/pass-parameter-between-pages/21108/1 "2018-11-28T11:10:38Z")

</div>

What way is used to pass parameters between pages in 8.0

---

<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:** [November 28, 2018, 3:07pm UTC](https://forum.inductiveautomation.com/t/pass-parameter-between-pages/21108/2 "2018-11-28T15:07:18Z")

</div>

I’m going to break my answer into two pieces because there’s a lot of confusion around the terminology between Views, Pages, Windows, and Sessions. To be clear, Windows are Vision, so I won’t be tackling that here. The only way to pass values between sessions is either through the database or Tags, so we’ll gloss past that as well.

Part One - Passing Values Between **Views** :

To pass a parameter to an **Embedded View** , create a new EmbeddedView.props.params property for each key you’d like to send. This key must be identical to the parameter the Embedded View will be expecting. In the case of the following screenshot, the Embedded View is expecting a parameter with a key of “id”.  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/7/7a99b018422c99919f693af1a111c7a33214d493.png)

**Carousel** Views are handled in the same manner, although the properties you’ll be configuring are called “viewPath” and “viewParams” instead of “path” and “params”.  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/4/477a5e3daec3c9cea0b5c634900f36868ae2a686.png)

**Popup** Views have their parameters configured in the Popup Action screen. In the following screenshot, my Popup View expects three parameters: “id”, “enable\_button”, and “parent\_count”. With Popup Views, you may only supply parameters to be read by the “child” View; there is no back-and-forth communication between the child and parent Views.  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/d/d7046017c5f07f170203d045f75ce93d8bb41e50.png)

---

<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:** [November 28, 2018, 3:24pm UTC](https://forum.inductiveautomation.com/t/pass-parameter-between-pages/21108/3 "2018-11-28T15:24:41Z")

</div>

Part Two - Passing Values Between **Pages** :

Something important to understand about “Pages” in Perspective is that they are simply Views which can be navigated to via a URL. So, just like Views, if they are not currently open in a browser tab then they don’t exist as part of the Session. Due to the uncertainty of the Session as to whether or not a Page is open (the Gateway knows what is open and where, but a user’s Session has no knowledge of any of that), you can not “pass” a parameter between pages. On top of that, if you have two tabs open to the same “page”, they both have a unique ID, so who would you be sending the message to?

But, this doesn’t mean you can’t use the Session to do everything you need.

**How To Do It** :

The best way to send values from one “page” to another is to use a Session Custom property. Use a script on MyPageAlpha to set `self.session.custom.myProp`, and make sure that MyPageBeta is binding (probably bi-directionally) to that same property.

**Alternatively** :

If and only if you absolutely know that you will have two tabs open and MyPageGamma is open in one tab, and MyPageDelta is open in the second, you could use the following code on MyPageGamma to “broadcast” a message.

`system.perspective.sendMessage(messageType='UniqueBroadcastNameHere', payload={'quasi_unique_key':'desired_value'}, scope='session')`

You would then want the component on MyPageDelta to have a configured Script which “listens” for the broadcast at the session scope with the following code waiting to execute:

`self.custom.my_value = payload['quasi_unique_key']`

I’ll work on getting a View set up to add to this thread so that you can see message handling in action.

---

<div class="post-metadata">

**Author:** ![oisin.gribben](https://avatars.discourse-cdn.com/v4/letter/o/9d8465/32.png) [@oisin.gribben](https://forum.inductiveautomation.com/u/oisin.gribben)\
**Post date:** [November 28, 2018, 3:55pm UTC](https://forum.inductiveautomation.com/t/pass-parameter-between-pages/21108/4 "2018-11-28T15:55:03Z")

</div>

@cmallonee  
Thanks for your detailed reply.  
I have tried the part with setting the session propert which I have attached below in a screen shot.  
The property doesn’t seem to be changing.  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/a1ef045a60fc389514c40ded69309a697df0e1d0.png)

---

<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:** [November 28, 2018, 3:56pm UTC](https://forum.inductiveautomation.com/t/pass-parameter-between-pages/21108/5 "2018-11-28T15:56:43Z")

</div>

Sorry, that answer could have been more clear - I’ll update it.

Scripts have no concept of “session”; you must reference session from the context of the component. Please try:

`self.session.custom.tagPath = "Testing"`

---

<div class="post-metadata">

**Author:** ![oisin.gribben](https://avatars.discourse-cdn.com/v4/letter/o/9d8465/32.png) [@oisin.gribben](https://forum.inductiveautomation.com/u/oisin.gribben)\
**Post date:** [November 28, 2018, 4:08pm UTC](https://forum.inductiveautomation.com/t/pass-parameter-between-pages/21108/6 "2018-11-28T16:08:08Z")

</div>

@cmallonee  
I made the chnages and still no change in the properties.  
I noticed that in the error logs i get this error everytime I click the button to navigate to the new page.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/ba8736bf2ba987aeee66be7fa08bd57cfeafd9d8.png)

---

<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:** [November 28, 2018, 4:14pm UTC](https://forum.inductiveautomation.com/t/pass-parameter-between-pages/21108/7 "2018-11-28T16:14:36Z")

</div>

Are you using an onClick Event to do both a Script Action and a Navigate Action? If so, there is a known issue around chaining those two actions in one event.

If you are not, please Save your project and restart your Designer. You should also consider closing out any open Sessions, waiting for them to expire on the Gateway (120 seconds), and then you can try again.

---

<div class="post-metadata">

**Author:** ![oisin.gribben](https://avatars.discourse-cdn.com/v4/letter/o/9d8465/32.png) [@oisin.gribben](https://forum.inductiveautomation.com/u/oisin.gribben)\
**Post date:** [November 28, 2018, 4:18pm UTC](https://forum.inductiveautomation.com/t/pass-parameter-between-pages/21108/8 "2018-11-28T16:18:38Z")

</div>

Yes I am doing both. That must be the issue.

---

<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:** [November 28, 2018, 4:21pm UTC](https://forum.inductiveautomation.com/t/pass-parameter-between-pages/21108/9 "2018-11-28T16:21:49Z")

</div>

Potentially…

The current workaround is to perform the navigation _as part of your script action_.

You should include `system.perspective.navigate(page='/my/page/url')` as the final part of your script.

Check out the [documentation](https://docs.inductiveautomation.com/display/DOC80/system.perspective.navigate) if you need assistance with the method.

---

<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:** [November 28, 2018, 5:13pm UTC](https://forum.inductiveautomation.com/t/pass-parameter-between-pages/21108/10 "2018-11-28T17:13:30Z")

</div>

[BetaDemo.proj](https://us1.discourse-cdn.com/inductiveautomation/original/2X/c/ce42e3814ced24b500e66d299008ef385ba8453c.proj) (28.1 KB)

This should provide a basic overview of how to use sendMessage().

---

<div class="post-metadata">

**Author:** ![grietveld](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/grietveld/32/6984_2.png) [@grietveld](https://forum.inductiveautomation.com/u/grietveld)\
**Post date:** [March 11, 2019, 7:30pm UTC](https://forum.inductiveautomation.com/t/pass-parameter-between-pages/21108/11 "2019-03-11T19:30:17Z")

</div>

> [@cmallonee](#):
>
> **Popup** Views have their parameters configured in the Popup Action screen. In the following screenshot, my Popup View expects three parameters: “id”, “enable\_button”, and “parent\_count”. With Popup Views, you may only supply parameters to be read by the “child” View; there is no back-and-forth communication between the child and parent Views.

Is there a way to get the screenshot reloaded? Or is this documented anywhere yet in the manual? I'm starting to explore it and I'm struggling to get my parameter to get passed from the parent to the child.

---

<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:** [March 11, 2019, 8:47pm UTC](https://forum.inductiveautomation.com/t/pass-parameter-between-pages/21108/12 "2019-03-11T20:47:12Z")

</div>

We’re working on resolving the other screenshots mysteriously disappearing, but this should help in the meantime.

Available params already defined by the specified View are visible by clicking the `+` icon:

 ![09%20PM](https://us1.discourse-cdn.com/inductiveautomation/original/2X/9/9056626861912588dae5bff7c48996e6de846295.png)

Choose what params you want to specify bound/assigned values for (you can either hard-code values or bind to an existing property at the session or View level):  
 ![39%20PM](https://us1.discourse-cdn.com/inductiveautomation/original/2X/1/1c00183c4fbda3a67c7f7696bd77d402a6e7115a.png)

You can perform the same parameter passing in a script:

```auto
	popup_id = 'a-unique-id'
	view = 'ParamViews/ParamView' # path relative to the "Views" directory, with no leading slash.
	param_dictionary = dict()
	param_dictionary['param_one'] = '1'
	param_dictionary['param_one'] = 'and 2'
	param_dictionary['param_one'] = self.props.text
	system.perspective.openPopup(id=popup_id,view=view,params=param_dictionary)

```

---

<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:** [March 12, 2019, 2:55pm UTC](https://forum.inductiveautomation.com/t/pass-parameter-between-pages/21108/13 "2019-03-12T14:55:14Z")

</div>

Split this topic on March 12, 2019, 2:55pm UTC

2 posts were split to a new topic: [Popup Views Fail To Interpret Parameters Which Are Objects](https://forum.inductiveautomation.com/t/popup-views-fail-to-interpret-parameters-which-are-objects/23247)

---

<div class="post-metadata">

**Author:** ![Andrew\_Brown](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@Andrew\_Brown](https://forum.inductiveautomation.com/u/Andrew_Brown)\
**Post date:** [December 3, 2024, 2:07pm UTC](https://forum.inductiveautomation.com/t/pass-parameter-between-pages/21108/14 "2024-12-03T14:07:13Z")

</div>

this is still a problem!

---

<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:** [December 3, 2024, 4:37pm UTC](https://forum.inductiveautomation.com/t/pass-parameter-between-pages/21108/15 "2024-12-03T16:37:34Z")

</div>

What is still a problem?

---

<div class="post-metadata">

**Author:** ![Andrew\_Brown](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@Andrew\_Brown](https://forum.inductiveautomation.com/u/Andrew_Brown)\
**Post date:** [December 4, 2024, 8:33pm UTC](https://forum.inductiveautomation.com/t/pass-parameter-between-pages/21108/16 "2024-12-04T20:33:50Z")

</div>

@cmallonee I meant to place my reply here, i was referring to using an onClick Event to do both a Script Action and a Navigate Action. It still doesnt work. which led me here, but thankfully your workaround solved the problem!
