# refreshBinding not working with Embedded View params

**URL:** <https://forum.inductiveautomation.com/t/refreshbinding-not-working-with-embedded-view-params/84053>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [January 10, 2024, 5:20pm UTC](https://forum.inductiveautomation.com/t/refreshbinding-not-working-with-embedded-view-params/84053 "2024-01-10T17:20:11Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paulo\_Custodio](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paulo_custodio/32/56599_2.png) [@Paulo\_Custodio](https://forum.inductiveautomation.com/u/Paulo_Custodio)\
**Post date:** [January 10, 2024, 5:20pm UTC](https://forum.inductiveautomation.com/t/refreshbinding-not-working-with-embedded-view-params/84053/1 "2024-01-10T17:20:11Z")

</div>

I have an embedded view which has a param called "value". This value has a Tag History binding, that works perfectly when the page startup. However, as this value doesn't update by itself, I added message handler to receive a msg from a timer, and inside the message handler I have this:

self.refreshBinding("props.params.value")

No error on the gateway logs, and the message handler is working because I also added the system.perspective.print and I can see it being called.

Thank you in advance for your help.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [January 10, 2024, 5:29pm UTC](https://forum.inductiveautomation.com/t/refreshbinding-not-working-with-embedded-view-params/84053/2 "2024-01-10T17:29:01Z")

</div>

View parameters are only read on initial loading of the view.

One way to fix it would be to create the binding on a session variable and have the embedded view reference that. How well this would work for you depends on the structure of your project.

---

<div class="post-metadata">

**Author:** ![Paulo\_Custodio](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paulo_custodio/32/56599_2.png) [@Paulo\_Custodio](https://forum.inductiveautomation.com/u/Paulo_Custodio)\
**Post date:** [January 10, 2024, 5:52pm UTC](https://forum.inductiveautomation.com/t/refreshbinding-not-working-with-embedded-view-params/84053/3 "2024-01-10T17:52:14Z")

</div>

So I created a custom variable called goodCount, and pasted the view param "value" binding to it, and referenced the params "value" to it. Now my refresh binding is:

self.refreshBinding("custom.goodCount")

However, it still doesn't seem to work.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [January 10, 2024, 5:55pm UTC](https://forum.inductiveautomation.com/t/refreshbinding-not-working-with-embedded-view-params/84053/4 "2024-01-10T17:55:50Z")

</div>

> [@Paulo\_Custodio](#):
>
> and pasted the view param "value" binding to it, and referenced the params "value" to it.

Sorry, it's not clear what you have done there. Can you show a screenshot of the binding and paste any code code (using the \</\> formatting button).

---

<div class="post-metadata">

**Author:** ![Paulo\_Custodio](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paulo_custodio/32/56599_2.png) [@Paulo\_Custodio](https://forum.inductiveautomation.com/u/Paulo_Custodio)\
**Post date:** [January 10, 2024, 6:02pm UTC](https://forum.inductiveautomation.com/t/refreshbinding-not-working-with-embedded-view-params/84053/5 "2024-01-10T18:02:01Z")

</div>

Of course. I'm sorry for the confusion.

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

The custom.goodCount now has the Tag History binding, while the params.value is pointing to it.

My self.refreshBinding is pointing to this custom.goodCount now, instead of the params.value.

And this is the Tag History binding.

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

Let me know if it was clear, and thank you for your time helping me with this.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [January 10, 2024, 8:10pm UTC](https://forum.inductiveautomation.com/t/refreshbinding-not-working-with-embedded-view-params/84053/6 "2024-01-10T20:10:44Z")

</div>

Thanks. The way that's set up at the moment you might as well apply the binding directly to `params.value` as it's just a copy of `custom.goodCount`.

Silly stuff checklist:

- You can't create a message listener on `props.custom` so you're listening on `props.params.value`, I presume.
- If you're running `self.refreshBinding` on `props.params.value` then you can't expect an update as all you're doing is copying whatever was already in `custom.goodcount`. You need to refresh `custom.goodcount` instead. This is another good reason to move the binding to `params.value` directly as then the `self.refreshBinding` would work.

---

<div class="post-metadata">

**Author:** ![Paulo\_Custodio](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paulo_custodio/32/56599_2.png) [@Paulo\_Custodio](https://forum.inductiveautomation.com/u/Paulo_Custodio)\
**Post date:** [January 10, 2024, 8:44pm UTC](https://forum.inductiveautomation.com/t/refreshbinding-not-working-with-embedded-view-params/84053/7 "2024-01-10T20:44:25Z")

</div>

When I first posted this problem, I didn't have the custom variable. I created it because you said "_View parameters are only read on initial loading of the view_." and as I had a self.refreshBinding("props.params.value"), and it wasn't working I created this custom variable to use the self.refreshBinding on it, which didn't work either.

---

<div class="post-metadata">

**Author:** ![Paulo\_Custodio](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paulo_custodio/32/56599_2.png) [@Paulo\_Custodio](https://forum.inductiveautomation.com/u/Paulo_Custodio)\
**Post date:** [January 10, 2024, 8:51pm UTC](https://forum.inductiveautomation.com/t/refreshbinding-not-working-with-embedded-view-params/84053/8 "2024-01-10T20:51:02Z")

</div>

I found out that the problem is that the `refreshBinding` doesn't update the `now(0)` variable in the End Date within the Tag History binding, and that was the problem.

The `refreshBinding` was pulling the same data because the `now(0)` didn't change, it kept the same value from the startup.

I think this is a bug when using `now(0)` in those dates and `refreshBinding` function doesn't update its value.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [January 10, 2024, 9:02pm UTC](https://forum.inductiveautomation.com/t/refreshbinding-not-working-with-embedded-view-params/84053/9 "2024-01-10T21:02:36Z")

</div>

I didn't notice that you were using `now()`.

You can fix that easily bearing the following information in mind:

- `now()` will execute at the default rate of every 1000 ms. (This is probably too often for a history query.
- `now(0)` will execute once.
- `now(123000)` will execute every 123 seconds.

[https://docs.inductiveautomation.com/display/DOC80/now](https://docs.inductiveautomation.com/display/DOC80/now)

---

<div class="post-metadata">

**Author:** ![Paulo\_Custodio](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paulo_custodio/32/56599_2.png) [@Paulo\_Custodio](https://forum.inductiveautomation.com/u/Paulo_Custodio)\
**Post date:** [January 10, 2024, 9:18pm UTC](https://forum.inductiveautomation.com/t/refreshbinding-not-working-with-embedded-view-params/84053/10 "2024-01-10T21:18:47Z")

</div>

That solved my problem. I don't even need the refreshBinding anymore.

Thank you very much!

---

<div class="post-metadata">

**Author:** ![tebright1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tebright1/32/87405_2.png) [@tebright1](https://forum.inductiveautomation.com/u/tebright1)\
**Post date:** [February 6, 2024, 9:22pm UTC](https://forum.inductiveautomation.com/t/refreshbinding-not-working-with-embedded-view-params/84053/11 "2024-02-06T21:22:02Z")

</div>

What was your solution? My embedded view only updates on load. Tag values change and the display is not updating.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [February 6, 2024, 9:38pm UTC](https://forum.inductiveautomation.com/t/refreshbinding-not-working-with-embedded-view-params/84053/12 "2024-02-06T21:38:09Z")

</div>

Paulo, can you click the **Solution** button on the answer that worked? Thanks.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [February 6, 2024, 9:40pm UTC](https://forum.inductiveautomation.com/t/refreshbinding-not-working-with-embedded-view-params/84053/13 "2024-02-06T21:40:53Z")

</div>

> [@tebright1](#):
>
> My embedded view only updates on load. Tag values change and the display is not updating.

Read back through the posts. Post #2 explains that view parameters are only read on initial loading of the view. Read the rest of the posts to see some possible solutions.

If you are still stuck then you'll have to show us your configuration.

---

<div class="post-metadata">

**Author:** ![Priyanka.Khandge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/priyanka.khandge/32/35989_2.png) [@Priyanka.Khandge](https://forum.inductiveautomation.com/u/Priyanka.Khandge)\
**Post date:** [February 7, 2024, 11:00am UTC](https://forum.inductiveautomation.com/t/refreshbinding-not-working-with-embedded-view-params/84053/14 "2024-02-07T11:00:48Z")

</div>

> [@Paulo\_Custodio](#):
>
> self.refreshBinding("props.params.value")

Here refreshBinding is defined in the wrong place.

```auto
self.props.refreshBinding("params.value")

```

---

<div class="post-metadata">

**Author:** ![tebright1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tebright1/32/87405_2.png) [@tebright1](https://forum.inductiveautomation.com/u/tebright1)\
**Post date:** [February 7, 2024, 2:28pm UTC](https://forum.inductiveautomation.com/t/refreshbinding-not-working-with-embedded-view-params/84053/15 "2024-02-07T14:28:35Z")

</div>

So I have a Dashboard on the screen. Those tag items with parameters are updating as expected. Will see if I can come up with a way to refresh the bindings. What allows the Dashboard to function correctly?

In my image the red x item the status is only changing on load. The green checkmarks items update normally on changes.

![Screenshot 2024-02-07 092650](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/c/8cf5af2115f3b36f9442b40f4daa6205c19e44fd.png)

---

<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:** [February 7, 2024, 2:32pm UTC](https://forum.inductiveautomation.com/t/refreshbinding-not-working-with-embedded-view-params/84053/16 "2024-02-07T14:32:47Z")

</div>

Where does the data for that red item come from ?  
What should trigger its update ?

---

<div class="post-metadata">

**Author:** ![tebright1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tebright1/32/87405_2.png) [@tebright1](https://forum.inductiveautomation.com/u/tebright1)\
**Post date:** [February 7, 2024, 2:34pm UTC](https://forum.inductiveautomation.com/t/refreshbinding-not-working-with-embedded-view-params/84053/17 "2024-02-07T14:34:32Z")

</div>

I have a binding on it.

I have other text fields that are referencing a parameter directly that don't update. Which are basically passing tags.

Expression on the image object:  
if(toBoolean({view.params.SiteStatus}),"/system/images/Icons/cow\_grn.png","/system/images/Icons/cow\_red.png")

 ![Screenshot 2024-02-07 093718](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/6/062368a1bc336a13a5232db27518b537279bd6bc.png)

---

<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:** [February 7, 2024, 2:39pm UTC](https://forum.inductiveautomation.com/t/refreshbinding-not-working-with-embedded-view-params/84053/18 "2024-02-07T14:39:09Z")

</div>

So the issue here is that the whole thing depends on a parameter. As explained before, parameters do not update.

How is that status passed to the view ? You could either make that dynamic, or move the logic that evaluates the status to INSIDE the view.

The whole thing really depends on how that status is computed.

---

<div class="post-metadata">

**Author:** ![tebright1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tebright1/32/87405_2.png) [@tebright1](https://forum.inductiveautomation.com/u/tebright1)\
**Post date:** [February 7, 2024, 2:42pm UTC](https://forum.inductiveautomation.com/t/refreshbinding-not-working-with-embedded-view-params/84053/19 "2024-02-07T14:42:31Z")

</div>

I see. I will try to pass the tag path and not the actual status.

The previous screen is a map. Each location you select passes parameters to the next screen. The information screen in my screenshot then populates based on the location data in the params.

---

<div class="post-metadata">

**Author:** ![tebright1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tebright1/32/87405_2.png) [@tebright1](https://forum.inductiveautomation.com/u/tebright1)\
**Post date:** [February 7, 2024, 2:49pm UTC](https://forum.inductiveautomation.com/t/refreshbinding-not-working-with-embedded-view-params/84053/20 "2024-02-07T14:49:36Z")

</div>

That worked. I added a numeric field and use that to monitor the tag value. I pass the Tag Path in my parameter. Been using Vision forever. Perspective is pretty tricky.

![Screenshot 2024-02-07 094814](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/3/a3cb82bb50fc94ee3e3e7faed5e9bfe02c4da591.png)

[Next page](https://forum.inductiveautomation.com/t/refreshbinding-not-working-with-embedded-view-params/84053.md?page=2)
