# View custom property dataset (from named query) not refreshing

**URL:** <https://forum.inductiveautomation.com/t/view-custom-property-dataset-from-named-query-not-refreshing/55134>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [January 18, 2022, 7:29pm UTC](https://forum.inductiveautomation.com/t/view-custom-property-dataset-from-named-query-not-refreshing/55134 "2022-01-18T19:29:23Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dennis.powell](https://avatars.discourse-cdn.com/v4/letter/d/848f3c/32.png) [@dennis.powell](https://forum.inductiveautomation.com/u/dennis.powell)\
**Post date:** [January 18, 2022, 7:29pm UTC](https://forum.inductiveautomation.com/t/view-custom-property-dataset-from-named-query-not-refreshing/55134/1 "2022-01-18T19:29:23Z")

</div>

Hi All,  
I have been trying to figure out this issue for a few days now and done a lot of searching. I have a custom property created on the View which pulls in a dataset from a Named Query. On the initial load of that page/view in a web browser the data is pulled in correctly with the right datetime stamp from the database showing when the query executed. However, when I try to reload the page in the browser, the data does not get reloaded and the datetime stamp is not updated from the database. The named query's cache is unchecked so it shouldn't be caching the data.

Is there something I am missing on this?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![matthew.ayre](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matthew.ayre/32/19499_2.png) [@matthew.ayre](https://forum.inductiveautomation.com/u/matthew.ayre)\
**Post date:** [January 18, 2022, 8:50pm UTC](https://forum.inductiveautomation.com/t/view-custom-property-dataset-from-named-query-not-refreshing/55134/2 "2022-01-18T20:50:04Z")

</div>

Hi @dennis.powell, I am not familiar with how it works, but I have experienced similar events. Not sure if it’s how the session persists… but there are way better people on here to explain it.

In short, I can’t answer your initial question, but I may be able to assist on what you are aiming to do (maybe 😅). I assume you require a refresh of the data based on an action, is this correct?

If so you can use the `refreshBinding()` script function. For example, edit the following code in the onActionPerformed event of a button to fit your circumstance: `self.view.refreshBinding("custom.property")`

---

<div class="post-metadata">

**Author:** ![dennis.powell](https://avatars.discourse-cdn.com/v4/letter/d/848f3c/32.png) [@dennis.powell](https://forum.inductiveautomation.com/u/dennis.powell)\
**Post date:** [January 18, 2022, 9:59pm UTC](https://forum.inductiveautomation.com/t/view-custom-property-dataset-from-named-query-not-refreshing/55134/3 "2022-01-18T21:59:50Z")

</div>

Hi @matthew.ayre, I tried that on the view itself in the OnStartUp event with no luck. All I’m trying to to is have get fresh data from the database when a user clicks on the browser’s “reload/refresh” button. Right now it is not refreshing and acting like the data is cached.

---

<div class="post-metadata">

**Author:** ![dennis.powell](https://avatars.discourse-cdn.com/v4/letter/d/848f3c/32.png) [@dennis.powell](https://forum.inductiveautomation.com/u/dennis.powell)\
**Post date:** [January 18, 2022, 10:08pm UTC](https://forum.inductiveautomation.com/t/view-custom-property-dataset-from-named-query-not-refreshing/55134/4 "2022-01-18T22:08:00Z")

</div>

Here is a screenshot of the page and what I’m doing. So the inital load will pull in the data and then I click on the web browser’s reload button (red arrow is pointing at it) and the page reloads, yet all the data is exactly the same as the initial page load. I also highlighted all the data that should be updated.

What is expected is that when the page reloads, the data is updated and the Date Range time to be updated. It currently is not.

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

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 18, 2022, 11:38pm UTC](https://forum.inductiveautomation.com/t/view-custom-property-dataset-from-named-query-not-refreshing/55134/5 "2022-01-18T23:38:22Z")

</div>

This is basically by design.

To Perspective, there’s no difference between a user reloading the page and the connection briefly dropping (e.g. due to spotty wifi). Since we don’t want to always reload the page in the latter case, we don’t always reload the page in the former case.

I think the Page Startup script event will capture a reload, so you could potentially add your own handling to this scenario that way.

---

<div class="post-metadata">

**Author:** ![dennis.powell](https://avatars.discourse-cdn.com/v4/letter/d/848f3c/32.png) [@dennis.powell](https://forum.inductiveautomation.com/u/dennis.powell)\
**Post date:** [January 19, 2022, 3:29pm UTC](https://forum.inductiveautomation.com/t/view-custom-property-dataset-from-named-query-not-refreshing/55134/6 "2022-01-19T15:29:51Z")

</div>

Thanks for the reply @paul-griffith. That makes sense.

I have set up a button on the page for testing purposes and I can get a table that is bound to the Named Query to rebind/reload the data. However, I can’t seem to get a custom property set on the view that is bound to the Named Query to rebind/reload.  
I’ve tried the following script on the button OnActionPerformed.

vwProp = self.view.custom.CycleTimeData  
vwProp.refeshBinding(self.view.custom.CycleTimeData)

I even tried setting the refeshBinding to the view and neither worked. Am I setting up the script wrong or can the refreshBinding work on a Custom Property?

---

<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:** [January 19, 2022, 4:03pm UTC](https://forum.inductiveautomation.com/t/view-custom-property-dataset-from-named-query-not-refreshing/55134/7 "2022-01-19T16:03:00Z")

</div>

`self.view.refreshBinding("custom.CycleTimeData")`

---

<div class="post-metadata">

**Author:** ![dennis.powell](https://avatars.discourse-cdn.com/v4/letter/d/848f3c/32.png) [@dennis.powell](https://forum.inductiveautomation.com/u/dennis.powell)\
**Post date:** [January 19, 2022, 5:16pm UTC](https://forum.inductiveautomation.com/t/view-custom-property-dataset-from-named-query-not-refreshing/55134/8 "2022-01-19T17:16:15Z")

</div>

@cmallonee, Thank you! That worked on the button script. I tried it on the view onStartup event and it didn’t work. I even tried the below script with no luck.  
self.refreshBinding(“custom.CycleTimeData”)

I even tried a refreshBinding on the table OnStartup and it won’t refresh on a page reload from the browser.

---

<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:** [January 19, 2022, 6:14pm UTC](https://forum.inductiveautomation.com/t/view-custom-property-dataset-from-named-query-not-refreshing/55134/9 "2022-01-19T18:14:46Z")

</div>

As Paul said, page reload is deliberately _ **not** _ restarting your session/page/view. So of course the onStartup events aren’t running again. You will need something else (like the button) to make things refresh.

---

<div class="post-metadata">

**Author:** ![dennis.powell](https://avatars.discourse-cdn.com/v4/letter/d/848f3c/32.png) [@dennis.powell](https://forum.inductiveautomation.com/u/dennis.powell)\
**Post date:** [January 19, 2022, 6:39pm UTC](https://forum.inductiveautomation.com/t/view-custom-property-dataset-from-named-query-not-refreshing/55134/10 "2022-01-19T18:39:17Z")

</div>

@pturmel, Ok, I’ll go that route then. Thank you all for the help.

---

<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:** [January 19, 2022, 6:42pm UTC](https://forum.inductiveautomation.com/t/view-custom-property-dataset-from-named-query-not-refreshing/55134/11 "2022-01-19T18:42:44Z")

</div>

Here’s the problem you’re running into:

As far as Perspective is concerned, a browser refresh does NOT restart the page or the view, because a browser refresh is basically considered a short disconnect from the point-of-view of the Gateway. So in the past, users had no way to trigger a script if a user refreshed a page. To help, we bundled browser refresh events into triggers for the PAGE onStartup event so that users could reliably execute code during a browser refresh. We did nothing of the sort for Views. Your View is not technically directly connected to the Page, so you have no direct access (ie: from the page onStartup Event, you may not do something like `self.view`).

I think that we could make use of some trickery here. As of 8.1.12, Pages have a `urlParams` object which the View has access to.

In Page onStartup:

```auto
page.props.urlParams.refresh = True

```

Add a new custom property to the VIEW, and name it `refresh`.  
Bind this new property to `this.page.props.urlParams.refresh`, and make sure that you set the “Overlay opt-out” checkbox to be checked.  
This binding will also need a script transform:

```auto
if value:
    # only do this if the property is found and needs to be done
    self.refreshBinding("custom.CycleTimeData")
    self.page.props.urlParams.refresh = False
return value

```

---

<div class="post-metadata">

**Author:** ![louagejasper](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/louagejasper/32/86311_2.png) [@louagejasper](https://forum.inductiveautomation.com/u/louagejasper)\
**Post date:** [September 6, 2024, 8:50am UTC](https://forum.inductiveautomation.com/t/view-custom-property-dataset-from-named-query-not-refreshing/55134/12 "2024-09-06T08:50:39Z")

</div>

Where do you get the 'self.page.props.urlParams.refresh'? I don't see it in the page props, nor in the docs [Pages in Perspective | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/ignition-modules/perspective/pages-in-perspective#page-properties)

![Screenshot 2024-09-06 at 10.44.50](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/7/f7a084eebb00d5ec0e2ca15b2645978bb216ff55.png)

What I'm looking for is writing back to the urlParams, and seeing the url change in the browser without whole Ignition reloading.

---

<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:** [September 6, 2024, 1:18pm UTC](https://forum.inductiveautomation.com/t/view-custom-property-dataset-from-named-query-not-refreshing/55134/13 "2024-09-06T13:18:58Z")

</div>

It's an url parameter, so it's up to you to add it.  
Putting `page.props.urlParams.refresh = True` will create it.

> [@louagejasper](#):
>
> What I'm looking for is writing back to the urlParams, and seeing the url change in the browser

I don't think you can do that.

---

<div class="post-metadata">

**Author:** ![louagejasper](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/louagejasper/32/86311_2.png) [@louagejasper](https://forum.inductiveautomation.com/u/louagejasper)\
**Post date:** [September 6, 2024, 1:55pm UTC](https://forum.inductiveautomation.com/t/view-custom-property-dataset-from-named-query-not-refreshing/55134/14 "2024-09-06T13:55:39Z")

</div>

Ah, that was not my brightest moment, thanks.

But It's still not possible to write to the urlParams and seeing the change in the browser without a refresh, right?

---

<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:** [September 6, 2024, 1:58pm UTC](https://forum.inductiveautomation.com/t/view-custom-property-dataset-from-named-query-not-refreshing/55134/15 "2024-09-06T13:58:55Z")

</div>

Even with a refresh, I don't think what you write into `page.props.urlParams` will reflect back to the browser. Actually it might even be overwritten on refresh.

---

<div class="post-metadata">

**Author:** ![louagejasper](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/louagejasper/32/86311_2.png) [@louagejasper](https://forum.inductiveautomation.com/u/louagejasper)\
**Post date:** [September 6, 2024, 2:36pm UTC](https://forum.inductiveautomation.com/t/view-custom-property-dataset-from-named-query-not-refreshing/55134/16 "2024-09-06T14:36:23Z")

</div>

What I mean is doing this

`system.perspective.navigate("/new-page?test=5")`

It does give you '/new-page?test=5' in the browser, but it does not show up in the urlParams, unless you refresh. Thats unlucky if you want to rely all logic on that.

---

<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:** [September 6, 2024, 2:42pm UTC](https://forum.inductiveautomation.com/t/view-custom-property-dataset-from-named-query-not-refreshing/55134/17 "2024-09-06T14:42:16Z")

</div>

I'm pretty sure you need to use url navigation to pass url parameters.

---

<div class="post-metadata">

**Author:** ![louagejasper](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/louagejasper/32/86311_2.png) [@louagejasper](https://forum.inductiveautomation.com/u/louagejasper)\
**Post date:** [September 6, 2024, 2:53pm UTC](https://forum.inductiveautomation.com/t/view-custom-property-dataset-from-named-query-not-refreshing/55134/18 "2024-09-06T14:53:30Z")

</div>

Yup, which triggers a refresh, which is unfortunate.

---

<div class="post-metadata">

**Author:** ![hunterdg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hunterdg/32/67774_2.png) [@hunterdg](https://forum.inductiveautomation.com/u/hunterdg)\
**Post date:** [March 14, 2025, 6:27am UTC](https://forum.inductiveautomation.com/t/view-custom-property-dataset-from-named-query-not-refreshing/55134/19 "2025-03-14T06:27:55Z")

</div>

> [@cmallonee](#):
>
> In Page onStartup:
> 
> ```python
> page.props.urlParams.refresh = True
> 
> ```
> 
> Add a new custom property to the VIEW, and name it `refresh`.  
> Bind this new property to `this.page.props.urlParams.refresh`, and make sure that you set the “Overlay opt-out” checkbox to be checked.  
> This binding will also need a script transform:
> 
> ```python
> if value:
> # only do this if the property is found and needs to be done
> self.refreshBinding("custom.CycleTimeData")
> self.page.props.urlParams.refresh = False
> return value
> 
> ```

as of 8.1.45 none of these work - EDIT - _on fresh project start_:

```python
page.props.urlParams.refresh = True # page.props.urlParams doesn’t exist at page startup
page.props.urlParams = {'refresh’: True}
page.props.urlParams = dict(refresh = True)

page.props.urlParams = dict()
page.props.urlParams.refresh = True
page.props.urlParams[‘refresh’] = True

```

I finally settled on this (in page startup) after ~~hours~~ days of screwing around:

```python
page.props.urlParams = {} # instantiate
page.props.urlParams[‘refresh’] = True # set
page.props.urlParams.refresh = True # this works too but feels fragile

```

Maybe there’s something special about the setter/objectWrapper but unsure if there’s any way for me to find out (or I’m just missing something)

Strangely - i could get the `page.props.urlParams = dict(refresh = True)` method to work by _also_ firing `page.props.urlParams.update()` on a view/component startup method…. really seems like I’m just missing something at this point

`refresh` property (on _any_ component - I explicitly avoid view custom props) **bidirectionally** bound (so i can toggle/display in a urlParams debug dock) to `page.props.urlParams.refresh` (`this` prefix is not valid) with a _change script_ for the binding refresh/property reset (biderectional bindings prevent script transforms). Also unsure the original rationale for overlay opt-out.

be sure to empty-cache-and-hard-refresh browser and launch designer from scratch (some combination of change script triggering and page startup not firing with File \> Open)

* * *

**EDIT**

I just realized page.props.urlParams _does_ exist on a page refresh, just not a _fresh_ page startup, so ~~better~~ quicker workaround for this specific issue (to avoid designer/gateway errors):  
`if hasattr(page.props, 'urlParams'): page.props.urlParams.refresh = True`

FWIW, the “instantiation” method above creates the refresh property in the page.props.urlParams tree so it’s visible/selectable in binding property browser and avoids the `Bad_NotFound` overlay/warning in designer property tree (which itself doesn’t appear to be avoided by overlay-opt-out checkbox)

Unfortunately I’m also attempting to set _other_ **page**.props.urlParams on actual **page** _startup_, not just refresh. Perhaps that’s what initially let me down this rabbit hole

Fun fact (to me anyawy): _page_ startup in **designer** thinks it’s _ **gateway** _ scope?

---

<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:** [March 14, 2025, 8:35am UTC](https://forum.inductiveautomation.com/t/view-custom-property-dataset-from-named-query-not-refreshing/55134/20 "2025-03-14T08:35:52Z")

</div>

> [@hunterdg](#):
>
> Fun fact (to me anyawy): _page_ startup in **designer** thinks it’s _ **gateway** _ scope?

Perspective sessions run in the gateway including all python scripts, so yep, it's in gateway scope

[Next page](https://forum.inductiveautomation.com/t/view-custom-property-dataset-from-named-query-not-refreshing/55134.md?page=2)
