# Perspective Designer expression binding race condition with script transform (Expression binding timing out)

**URL:** <https://forum.inductiveautomation.com/t/perspective-designer-expression-binding-race-condition-with-script-transform-expression-binding-timing-out/53719>\
**Category:** Ignition\
**Created:** [December 3, 2021, 10:04am UTC](https://forum.inductiveautomation.com/t/perspective-designer-expression-binding-race-condition-with-script-transform-expression-binding-timing-out/53719 "2021-12-03T10:04:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![r.p](https://avatars.discourse-cdn.com/v4/letter/r/71e660/32.png) [@r.p](https://forum.inductiveautomation.com/u/r.p)\
**Post date:** [December 3, 2021, 10:04am UTC](https://forum.inductiveautomation.com/t/perspective-designer-expression-binding-race-condition-with-script-transform-expression-binding-timing-out/53719/1 "2021-12-03T10:04:27Z")

</div>

Hi,  
suppose I have a custom variable “cities” which returns a json array of 541 cities of the world (extracted from [GitHub - lutangar/cities.json: Cities of the world in Json, based on GeoNames Gazetteer](https://github.com/lutangar/cities.json)):

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

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

and a text label which fetches the first element of this array:

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

we experienced race conditions where the designer previews the first city name correctly,  
while the browser shows an error message (below I highlighted designer preview and browser and the fact I am using incognito so no caching in the browser):

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

we have an idea of the reason why this happens however I was wondering whether this is a known bug which will be fixed soon or there’s some known limitation which will be documented.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [December 3, 2021, 10:28am UTC](https://forum.inductiveautomation.com/t/perspective-designer-expression-binding-race-condition-with-script-transform-expression-binding-timing-out/53719/2 "2021-12-03T10:28:55Z")

</div>

Bindings do not work in order.  
You are using an expression to trigger the binding. But since you only set it to “True”, both will only trigger once in a “random” order.  
If you want the text to update when the other binding has finished with the script you will have to put a reference to that in the expression (or property).

I advice not to put an array like that in a binding script tho, there is no reason to it if it stays static.  
Also you might consider putting it as a static custom session prop instead of on a view  
It will up the performance and you wont have to worry it not being loaded yet for the other binding

---

<div class="post-metadata">

**Author:** ![r.p](https://avatars.discourse-cdn.com/v4/letter/r/71e660/32.png) [@r.p](https://forum.inductiveautomation.com/u/r.p)\
**Post date:** [December 3, 2021, 10:42am UTC](https://forum.inductiveautomation.com/t/perspective-designer-expression-binding-race-condition-with-script-transform-expression-binding-timing-out/53719/3 "2021-12-03T10:42:16Z")

</div>

Ok, just wanted confirmation that expressions trigger once in random order when they are set to True.  
This was of course an artificial example.  
Thank you
