# Configure bindings with script

**URL:** <https://forum.inductiveautomation.com/t/configure-bindings-with-script/84874>\
**Category:** Ignition\
**Tags:** ignition81, perspective, scripting\
**Created:** [January 29, 2024, 8:27am UTC](https://forum.inductiveautomation.com/t/configure-bindings-with-script/84874 "2024-01-29T08:27:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vatsal\_Shah](https://avatars.discourse-cdn.com/v4/letter/v/0ea827/32.png) [@Vatsal\_Shah](https://forum.inductiveautomation.com/u/Vatsal_Shah)\
**Post date:** [January 29, 2024, 8:27am UTC](https://forum.inductiveautomation.com/t/configure-bindings-with-script/84874/1 "2024-01-29T08:27:09Z")

</div>

Is there any way we can configure bindings on a particular component through scripting.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [January 29, 2024, 9:00am UTC](https://forum.inductiveautomation.com/t/configure-bindings-with-script/84874/2 "2024-01-29T09:00:22Z")

</div>

Nope.

What do you want to do ?

---

<div class="post-metadata">

**Author:** ![MSviga](https://avatars.discourse-cdn.com/v4/letter/m/3e96dc/32.png) [@MSviga](https://forum.inductiveautomation.com/u/MSviga)\
**Post date:** [January 29, 2024, 11:26am UTC](https://forum.inductiveautomation.com/t/configure-bindings-with-script/84874/3 "2024-01-29T11:26:51Z")

</div>

I wish.

---

<div class="post-metadata">

**Author:** ![automatisation](https://avatars.discourse-cdn.com/v4/letter/a/94ad74/32.png) [@automatisation](https://forum.inductiveautomation.com/u/automatisation)\
**Post date:** [January 29, 2024, 2:58pm UTC](https://forum.inductiveautomation.com/t/configure-bindings-with-script/84874/4 "2024-01-29T14:58:45Z")

</div>

You could, by getting the view json with `IgnitionGateway.get()`, editing this json the way you want, and writing it back to the correct location.

Here is a code that should do the trick:

```auto
from com.inductiveautomation.ignition.gateway import IgnitionGateway
context = IgnitionGateway.get()
path = "%s/projects/YOURPROJECT/com.inductiveautomation.perspective/views/YOURVIEW/view.json"%(str(context.systemManager.dataDir.absoluteFile).replace('\\','/'))
json = system.file.readFileAsString(path)
data = system.util.jsonDecode(json)

#You edit the json here

new_json = system.util.jsonEncode(data)
system.file.writeFile(path, new_json)

```

Note that you'll have to wait a few minutes for the changes to be applied

---

<div class="post-metadata">

**Author:** ![Alex\_DeBate](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alex_debate/32/56483_2.png) [@Alex\_DeBate](https://forum.inductiveautomation.com/u/Alex_DeBate)\
**Post date:** [January 29, 2024, 3:18pm UTC](https://forum.inductiveautomation.com/t/configure-bindings-with-script/84874/5 "2024-01-29T15:18:47Z")

</div>

What are you trying to accomplish?
