Zoho Creator: Prevent Endless Loops On User Input of a Field
- Joel Lipman
- Zoho
- Hits: 2855
This article serves as a best practice and reminder to myself on how to stop endless loops from happening in Creator and crashing the application. This is more for complex Creator forms which have workflows triggered from many deltas/changes.
Why?
Some clients have referred to this as the "spinning circle of death": they load up a Creator application or change a field and there will be a spinning icon indicating that the field has triggered an automation/workflow but it keeps spinning and doesn't stop. The app page will ultimately timeout and when reloading the form it simply displays a blank page. Their only workaround is wait about 30 seconds or more for the loop to automatically cut out and then they can use the interface again only to find it may crash again.
In the background and from a developers understanding: field1 is told to update field2 when field1 is changed. When field2 is changed, it is told to update field1. This causes a recursive or endless loop where each field triggers an workflow/automation, even if the value has not changed, to modify another field and vice-versa. This can get more complex when there are a lot of fields in the mix.
How?
I'm using this article to go through various methods I tried to prevent this from happening: