# Perspective page/object updates

**URL:** <https://forum.inductiveautomation.com/t/perspective-page-object-updates/25078>\
**Category:** Ignition\
**Created:** [May 16, 2019, 6:12pm UTC](https://forum.inductiveautomation.com/t/perspective-page-object-updates/25078 "2019-05-16T18:12:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JohnMck](https://avatars.discourse-cdn.com/v4/letter/j/eada6e/32.png) [@JohnMck](https://forum.inductiveautomation.com/u/JohnMck)\
**Post date:** [May 16, 2019, 6:12pm UTC](https://forum.inductiveautomation.com/t/perspective-page-object-updates/25078/1 "2019-05-16T18:12:21Z")

</div>

I have several objects on a perspective view (table, 2 xycharts) that all use the same underlying dataset, in this case, a Named Query. This particular view will be re-used on several pages with minor parameter value changes.

What is the best way to:

1. Only have a single query occur to update all objects rather than each object rerunning the query.
2. Update the objects when the underlying query changes. I have a tag that changes value whenever the database tables are updated. I thought about using a dataset tag but can’t seem to write to it in the tag change event script (“read only error”). Also the dataset could get large (1000+ rows). There is a polling option, but that would generate a lot of unnecessary querying if the system is idle.

All suggestions appreciated!! Thanks!

---

<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:** [May 16, 2019, 7:31pm UTC](https://forum.inductiveautomation.com/t/perspective-page-object-updates/25078/2 "2019-05-16T19:31:23Z")

</div>

If all three use the same data:

1. Supply Named Value query params as View params (`MyView.params.query_param_one` /two /three, or as an object where each internal key is a param)
2. Make a new property, `MyView.custom.data`, which is bound to your Named Query and supplies the values you’re receiving from `MyView.params`.
3. Bind the `props.data` for each of your components to `MyView.custom.data`.

In this way, the query is only being run once per View, instead of once per component.

---

<div class="post-metadata">

**Author:** ![JohnMck](https://avatars.discourse-cdn.com/v4/letter/j/eada6e/32.png) [@JohnMck](https://forum.inductiveautomation.com/u/JohnMck)\
**Post date:** [May 17, 2019, 1:23pm UTC](https://forum.inductiveautomation.com/t/perspective-page-object-updates/25078/3 "2019-05-17T13:23:52Z")

</div>

Perfect!! Thanks for the quick reply.  
Still getting use to the CUSTOM property feature - something that’s been wanted for a long time.

For the second part of that question:  
How can I force the new data property to update other than by a poll rate? I do have a tag “DataTrigger” that increments whenever new data is available in the database.

---

<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:** [May 17, 2019, 2:41pm UTC](https://forum.inductiveautomation.com/t/perspective-page-object-updates/25078/4 "2019-05-17T14:41:33Z")

</div>

A Named Query Binding should update whenever one of the supplied params changes, if memory serves me correctly.

You could also trigger manual refreshes of the query by using some Event to trigger a Script Action which then calls `self.view.refreshBinding("custom.data")`, so just provide a Script Action to your trigger tag with the provided code. You shouldn’t ned to do anything to the components because the refresh of the Named Query should be picked up by the component bindings on `View.custom.data`.

---

<div class="post-metadata">

**Author:** ![JohnMck](https://avatars.discourse-cdn.com/v4/letter/j/eada6e/32.png) [@JohnMck](https://forum.inductiveautomation.com/u/JohnMck)\
**Post date:** [May 22, 2019, 6:48pm UTC](https://forum.inductiveautomation.com/t/perspective-page-object-updates/25078/5 "2019-05-22T18:48:22Z")

</div>

Sorry for the delayed response, your were correct about the update event on a parameter change.  
Just finished coding an update of a view embedded in a view embedded in a carousel within a view that was tied to a menu tree selection. Parameter passing worked exactly as advertised!

Thanks for all the help!
