# Perspective page urlParams issue

**URL:** <https://forum.inductiveautomation.com/t/perspective-page-urlparams-issue/68607>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [January 15, 2023, 6:07pm UTC](https://forum.inductiveautomation.com/t/perspective-page-urlparams-issue/68607 "2023-01-15T18:07:10Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [January 15, 2023, 6:07pm UTC](https://forum.inductiveautomation.com/t/perspective-page-urlparams-issue/68607/1 "2023-01-15T18:07:10Z")

</div>

Hi all,  
I'm developing a perspective view (Ignition **8.1.23 (b2022121308)**) where I need to get the _url query parameters_, which will be sent to SQL Server for further elaboration via named query. I've created a custom property `queryParams` on the view, whose binding I've set to `page.props.urlParams`. Unfortunately I'm experiencing the following issue: when the page transition is caused by an item click on a `Menu Tree` component whose `target` property is set to a relative path (e.g. `/trend?tag=[default]myTag&trendType=1`) the view `queryParams` custom property does not get updated with the new url query parameters. Next I press **F5** and the custom property `queryParams` gets updated correctly. If the Menu Tree item's `target` property is configured with an absolute path (e.g. `http://<gateway_address>:8088/.......`) then a new browser tab is opened and the view `queryParams` custom property is correctly reporting the new `page.props.urlParams`. To further investigate, I set a `label` `text` property on the view to `page.props.urlParams` and I experienced the same issue: the label does not update with the new `page.props.urlParams` value, unless you press **F5** or you input the address directly in the address bar.  
Is that an issue or am I missing some important parameters?

Thanks in advance, regards

**UPDATE**  
Just read the bottom note at the following help page:  
[https://docs.inductiveautomation.com/display/DOC81/Pages+in+Perspective#PagesinPerspective-PassingParameters(URLParameters)](https://docs.inductiveautomation.com/display/DOC81/Pages+in+Perspective#PagesinPerspective-PassingParameters(URLParameters))  
Maybe that's the answer

---

<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:** [January 16, 2023, 9:32am UTC](https://forum.inductiveautomation.com/t/perspective-page-urlparams-issue/68607/2 "2023-01-16T09:32:30Z")

</div>

Indeed, I believe this is the reason.

So how to work around this ? Depends on exactly what you're trying to achieve, but the answer will probably be either `session.custom` or `message handlers`.  
Can you describe with more details and examples what your goal is ?

---

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [January 16, 2023, 10:45am UTC](https://forum.inductiveautomation.com/t/perspective-page-urlparams-issue/68607/3 "2023-01-16T10:45:31Z")

</div>

Hallo @pascal.fragnoud, thanks for your answer. I'm thinking to set the `target` property of the menu item to a null string, so that the menu item won't activate a page tansition. Instead I will use the `itemClick` event, where I will gather all the parameters I need and activate a page transition through the `system.perspective.navigate` function - according to the user manual, that is the only instruction that will cause Ignition to assign `page.props.urlParams` correctly.

---

<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:** [January 16, 2023, 10:51am UTC](https://forum.inductiveautomation.com/t/perspective-page-urlparams-issue/68607/4 "2023-01-16T10:51:40Z")

</div>

There might be more appropriate ways than the url to pass the required data.  
But we can't say until we have more information about your use case...

From what I gather so far, it looks like you have a page where data is collected, and this data is then sent through the url to another page, that will use that data to send a query. Is that correct ?  
If so, I really, really think that there must be a better way.

---

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [January 16, 2023, 11:11am UTC](https://forum.inductiveautomation.com/t/perspective-page-urlparams-issue/68607/5 "2023-01-16T11:11:33Z")

</div>

To sum up: all the _Menu Tree_ items points to the same page. On that page I show the trend of the tag which the operator selected with the menu tree item click. I think that passing the tag name as a URL query parameter is the quickest way, provided that it works .. and indeed it doesn't, because of the `page.props.urlParams` limitation.

---

<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:** [January 16, 2023, 11:53am UTC](https://forum.inductiveautomation.com/t/perspective-page-urlparams-issue/68607/6 "2023-01-16T11:53:42Z")

</div>

I suspect you're not using the powerchart because you want to control the tags that the user can see ?  
In that case, why not just put a dropdown on the page where your chart is ?

Is the menu still available on the chart page ?  
Is there something else that needs to be passed (I see a `trendType=1` in your first post) ?  
What are the constraints and requirements for this ?

---

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [January 16, 2023, 11:59am UTC](https://forum.inductiveautomation.com/t/perspective-page-urlparams-issue/68607/7 "2023-01-16T11:59:08Z")

</div>

> [@pascal.fragnoud](#):
>
> In that case, why not just put a dropdown on the page where your chart is ?

I need the menu tree structured view, because the tags must be grouped into areas, sub-areas, sub-sub-sub and so on. And yes, I need to pass some more information.

---

<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:** [January 16, 2023, 12:03pm UTC](https://forum.inductiveautomation.com/t/perspective-page-urlparams-issue/68607/8 "2023-01-16T12:03:19Z")

</div>

How about using the `onItemClicked` event to change the tagpath directly on your charting component, instead of navigating to a new page ?  
Or is there a reason you need to navigate to a new page ?

---

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [January 16, 2023, 12:49pm UTC](https://forum.inductiveautomation.com/t/perspective-page-urlparams-issue/68607/9 "2023-01-16T12:49:14Z")

</div>

> [@pascal.fragnoud](#):
>
> How about using the `onItemClicked` event

Somehow is what I'm going to do. Navigation is needed because the menutree is in a left docked view and the very first view won't be the trend view, but a welcome view or anything else.

---

<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:** [January 16, 2023, 1:01pm UTC](https://forum.inductiveautomation.com/t/perspective-page-urlparams-issue/68607/10 "2023-01-16T13:01:15Z")

</div>

Then you can probably use view navigation instead of page navigation, which would allow you to pass view parameters instead of url parameters.
