# On-change script in the Flex Repeater is causing a refresh loop error

**URL:** <https://forum.inductiveautomation.com/t/on-change-script-in-the-flex-repeater-is-causing-a-refresh-loop-error/114665>\
**Category:** Ignition\
**Created:** [March 25, 2026, 11:29am UTC](https://forum.inductiveautomation.com/t/on-change-script-in-the-flex-repeater-is-causing-a-refresh-loop-error/114665 "2026-03-25T11:29:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anita.Shinde](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Anita.Shinde](https://forum.inductiveautomation.com/u/Anita.Shinde)\
**Post date:** [March 25, 2026, 11:29am UTC](https://forum.inductiveautomation.com/t/on-change-script-in-the-flex-repeater-is-causing-a-refresh-loop-error/114665/1 "2026-03-25T11:29:51Z")

</div>

I’m using a Flex Repeater to display good, rework, and scrap quantities.

Based on the values entered, the system prompts for additional data such as scrap codes and rework codes.

I have on‑change scripts on these three fields, and when multiple work orders are present, the client starts flickering because the on‑change script keeps executing continuously.

Because of this continuous execution, the data bindings are also picking up incorrect values.

I am binding the quantity to the numeric field based on whether it is good, scrap, or rework. For every row script is executing 3 times.

“Your quick help would be greatly appreciated.”

on change script

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/9/89436806105e6e314a65a89886b87303a2a01dde.png)

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

Thanks.

---

<div class="post-metadata">

**Author:** ![tgarrison](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tgarrison/32/80965_2.png) [@tgarrison](https://forum.inductiveautomation.com/u/tgarrison)\
**Post date:** [March 25, 2026, 12:56pm UTC](https://forum.inductiveautomation.com/t/on-change-script-in-the-flex-repeater-is-causing-a-refresh-loop-error/114665/2 "2026-03-25T12:56:31Z")

</div>

You need to not do it on each field that could change if they need to enter more than one field of info before the refresh.

Give them a button to push to do the refresh on-demand. You could even make it appear when they've got "valid" values in the fields to help enforce appropriate timing.

---

<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:** [March 25, 2026, 12:59pm UTC](https://forum.inductiveautomation.com/t/on-change-script-in-the-flex-repeater-is-causing-a-refresh-loop-error/114665/3 "2026-03-25T12:59:21Z")

</div>

In addition to Ted's advice, you should also be checking the `origin` of the event, and ignoring changes that aren't coming from the user (via the browser).

> **[origin​ - Perspective Property Change Scripts | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/ignition-modules/perspective/scripting-in-perspective/perspective-property-change-scripts#origin)**
>
> The origin of the property value, as a unicode string. The origin parameter will take on one of six types depending on how the property value is being updated: | With Perspective, individual component properties can have a property change script....

---

<div class="post-metadata">

**Author:** ![Anita.Shinde](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Anita.Shinde](https://forum.inductiveautomation.com/u/Anita.Shinde)\
**Post date:** [March 25, 2026, 4:01pm UTC](https://forum.inductiveautomation.com/t/on-change-script-in-the-flex-repeater-is-causing-a-refresh-loop-error/114665/4 "2026-03-25T16:01:43Z")

</div>

In my case, I can’t add a button at this stage.

I will refactor it later by introducing a button, but for now I need a workaround.

The change script should execute when the user modifies the field and when the screen loads.

Is there any quick fix for this?

Also, will the ‘origin’ property help in situations where the user enters data from the browser and it is bidirectional, as this is the flex repeater instances.

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [March 25, 2026, 4:44pm UTC](https://forum.inductiveautomation.com/t/on-change-script-in-the-flex-repeater-is-causing-a-refresh-loop-error/114665/5 "2026-03-25T16:44:34Z")

</div>

Unless its triggering off of a timestamp, `previousValue.value != currentValue.value` will always evaluate to true, which is what is causing your loop.

> [@Anita.Shinde](#):
>
> will the ‘origin’ property help

Yes, User entry will show as 'Browser' origin but bindings will appear as 'Binding' origin. (This is detailed in the link that pturmel posted, take a look.)

For your use case, `if origin == 'Browser':` is likely enough of a check.

For triggering on page load, have an event script for the `onStartup` event that calls the exact same code as your message handler to initially load the page.

---

<div class="post-metadata">

**Author:** ![Anita.Shinde](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Anita.Shinde](https://forum.inductiveautomation.com/u/Anita.Shinde)\
**Post date:** [March 25, 2026, 5:07pm UTC](https://forum.inductiveautomation.com/t/on-change-script-in-the-flex-repeater-is-causing-a-refresh-loop-error/114665/6 "2026-03-25T17:07:36Z")

</div>

Thanks!!!

Let me try this.

---

<div class="post-metadata">

**Author:** ![Anita.Shinde](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Anita.Shinde](https://forum.inductiveautomation.com/u/Anita.Shinde)\
**Post date:** [March 26, 2026, 12:21pm UTC](https://forum.inductiveautomation.com/t/on-change-script-in-the-flex-repeater-is-causing-a-refresh-loop-error/114665/7 "2026-03-26T12:21:18Z")

</div>

it’s working perfectly-Thank you so much!!!

---

<div class="post-metadata">

**Author:** ![Anita.Shinde](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Anita.Shinde](https://forum.inductiveautomation.com/u/Anita.Shinde)\
**Post date:** [March 26, 2026, 1:27pm UTC](https://forum.inductiveautomation.com/t/on-change-script-in-the-flex-repeater-is-causing-a-refresh-loop-error/114665/8 "2026-03-26T13:27:28Z")

</div>

One more thing — the Flex Repeater is taking too long to load the data. Is there any workaround for this?  
All data is available but still showing error

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/4/14db601617f41effb7a0ba83ad56cf77989430bf.png)
