# Is it possible to change binding with scripting?

**URL:** <https://forum.inductiveautomation.com/t/is-it-possible-to-change-binding-with-scripting/11882>\
**Category:** Ignition\
**Created:** [June 30, 2016, 7:02am UTC](https://forum.inductiveautomation.com/t/is-it-possible-to-change-binding-with-scripting/11882 "2016-06-30T07:02:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Esn](https://avatars.discourse-cdn.com/v4/letter/e/91b2a8/32.png) [@Esn](https://forum.inductiveautomation.com/u/Esn)\
**Post date:** [June 30, 2016, 7:02am UTC](https://forum.inductiveautomation.com/t/is-it-possible-to-change-binding-with-scripting/11882/1 "2016-06-30T07:02:08Z")

</div>

Hi,

In my project I have bound several components color properties to memory tags with hex color code.

The idea was that I could then quickly change the color of several components by changing the hex code in one memory tag.

This works fine, but I’ve in a situation now where I have to change the binding of alot of the components.

Can this be done through scripting? Or do I have to go through them all by hand?

Thanks

---

<div class="post-metadata">

**Author:** ![fledder](https://avatars.discourse-cdn.com/v4/letter/f/e19b73/32.png) [@fledder](https://forum.inductiveautomation.com/u/fledder)\
**Post date:** [July 2, 2016, 12:47am UTC](https://forum.inductiveautomation.com/t/is-it-possible-to-change-binding-with-scripting/11882/2 "2016-07-02T00:47:25Z")

</div>

I’m not aware of a way to change the bindings through a script. Are you talking about e.g. batch changing bindings from one tag to another? That you can do through the find/replace utility in the designer.

---

<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:39am UTC](https://forum.inductiveautomation.com/t/is-it-possible-to-change-binding-with-scripting/11882/3 "2019-04-30T06:39:25Z")

</div>

You can try the following code to get your binding working from a script, running in Designer (7.9.10, at least):

```auto
context = IgnitionDesigner.getFrame().getContext()
vision = context.getModule(VisionDesignerInterface.VISION_MODULE_ID)
binding = ExpressionBindingConfig("Your expression source string", overlayOptOutFlag)
vision.configureBinding(component, propertyName, binding)

```

I believe, there should be a way to do it in a Client too, once you figure out how to get its context.
