# Dynamic binding to a list

**URL:** <https://forum.inductiveautomation.com/t/dynamic-binding-to-a-list/20288>\
**Category:** Ignition\
**Tags:** ignition79, scripting\
**Created:** [October 21, 2018, 10:03pm UTC](https://forum.inductiveautomation.com/t/dynamic-binding-to-a-list/20288 "2018-10-21T22:03:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![readywebsolutions](https://avatars.discourse-cdn.com/v4/letter/r/3da27b/32.png) [@readywebsolutions](https://forum.inductiveautomation.com/u/readywebsolutions)\
**Post date:** [October 21, 2018, 10:03pm UTC](https://forum.inductiveautomation.com/t/dynamic-binding-to-a-list/20288/1 "2018-10-21T22:03:55Z")

</div>

I'd like to create a binding, when a component's property depends on the list of other component, whose reference numbers are given in the form of a string (or a dataset). I could compile the expression string from the list of numbers in a script by **runScript()**. But, is there a way to evaluate that string later into a binding expression, using something similar to the **tag()** function, but with more than one tag?

> eval(runScript("project.compExpr", 0, {Component.dependList} )) // Tag1/BoolValue || ... || TagN/BoolValue

The reason I'd like to evaluate the string instead of simply computing the value in the script is that the listed components' properties are also bindable, so the string I compile needs to be reevaluated every time when they change.

Alternatively, can I "create" a binding in the script?

---

<div class="post-metadata">

**Author:** ![spirin.md](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@spirin.md](https://forum.inductiveautomation.com/u/spirin.md)\
**Post date:** [April 28, 2019, 9:03am UTC](https://forum.inductiveautomation.com/t/dynamic-binding-to-a-list/20288/2 "2019-04-28T09:03:16Z")

</div>

Hi! I’m looking for a way to create a binding in a script. Did you solve this problem?  
Anybody?

---

<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:** [April 28, 2019, 12:53pm UTC](https://forum.inductiveautomation.com/t/dynamic-binding-to-a-list/20288/3 "2019-04-28T12:53:25Z")

</div>

You can dig around in the JavaDocs, probably starting [here](http://files.inductiveautomation.com/sdk/javadoc/ignition79/795/com/inductiveautomation/factorypmi/application/binding/PropertyAdapter.html). Then looking at the InteractionController on each window. (Bindings are part of the window, not the component.)

---

<div class="post-metadata">

**Author:** ![readywebsolutions](https://avatars.discourse-cdn.com/v4/letter/r/3da27b/32.png) [@readywebsolutions](https://forum.inductiveautomation.com/u/readywebsolutions)\
**Post date:** [April 30, 2019, 6:46am UTC](https://forum.inductiveautomation.com/t/dynamic-binding-to-a-list/20288/4 "2019-04-30T06:46:16Z")

</div>

I’ve just posted a solution for the Designer context, that can be used, for example, for batch processing of multiple components, when templates are inapplicable:  
[http://forum.inductiveautomation.com/t/is-it-possible-to-change-binding-with-scripting/11882/3?u=readywebsolutions](http://forum.inductiveautomation.com/t/is-it-possible-to-change-binding-with-scripting/11882/3?u=readywebsolutions)

---

<div class="post-metadata">

**Author:** ![spirin.md](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@spirin.md](https://forum.inductiveautomation.com/u/spirin.md)\
**Post date:** [May 5, 2019, 6:25pm UTC](https://forum.inductiveautomation.com/t/dynamic-binding-to-a-list/20288/5 "2019-05-05T18:25:07Z")

</div>

> [@pturmel](#):
>
> You can dig around in the JavaDocs, probably starting [here](http://files.inductiveautomation.com/sdk/javadoc/ignition79/795/com/inductiveautomation/factorypmi/application/binding/PropertyAdapter.html). Then looking at the InteractionController on each window. (Bindings are part of the window, not the component.)

do you think it is possible in Perspective?

---

<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:** [May 5, 2019, 11:11pm UTC](https://forum.inductiveautomation.com/t/dynamic-binding-to-a-list/20288/6 "2019-05-05T23:11:26Z")

</div>

I have not spent enough time under the hood of perspective yet… All of the above is Vision-specific.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 7, 2019, 4:15pm UTC](https://forum.inductiveautomation.com/t/dynamic-binding-to-a-list/20288/7 "2019-05-07T16:15:17Z")

</div>

To create a binding in Perspective, you just need to modify the `view.json` file on disk on the gateway with (valid) JSON structure.
