# Using a script for writing to a Tag bound to a parameter

**URL:** <https://forum.inductiveautomation.com/t/using-a-script-for-writing-to-a-tag-bound-to-a-parameter/35140>\
**Category:** Ignition\
**Tags:** ignition80, scripting\
**Created:** [May 28, 2020, 8:47pm UTC](https://forum.inductiveautomation.com/t/using-a-script-for-writing-to-a-tag-bound-to-a-parameter/35140 "2020-05-28T20:47:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@peter](https://forum.inductiveautomation.com/u/peter)\
**Post date:** [May 28, 2020, 8:47pm UTC](https://forum.inductiveautomation.com/t/using-a-script-for-writing-to-a-tag-bound-to-a-parameter/35140/1 "2020-05-28T20:47:22Z")

</div>

I have a templated object that has a custom parameter, to which will be bound to a tag.  
I also have a mousePressed scripting event attached to same object.

What I want to do is within the script, is to write values to the tag that is bound to an instance of the object. But I don't see how/know to do this with the scripting functions. I know can write values to internal parameters using (for example)

> event.source.MyInternalParam = 1

But this doesn't seem to get propagated through to a bound tag.

My end goal is to have the equivalent of a standard button etc where the tag drop target is written to when the button is pressed. Is there anyway to achieve this? Or do I need to change my approach?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [May 28, 2020, 8:53pm UTC](https://forum.inductiveautomation.com/t/using-a-script-for-writing-to-a-tag-bound-to-a-parameter/35140/2 "2020-05-28T20:53:44Z")

</div>

Have you set the binding to bidirectional?

---

<div class="post-metadata">

**Author:** ![peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@peter](https://forum.inductiveautomation.com/u/peter)\
**Post date:** [May 28, 2020, 10:15pm UTC](https://forum.inductiveautomation.com/t/using-a-script-for-writing-to-a-tag-bound-to-a-parameter/35140/3 "2020-05-28T22:15:12Z")

</div>

OK … I have no idea what was going on. The binding was bidirectional. It always was bidirectional. Except now the code is working as expected.

I’m going to delete this question after I patch the hole in my desk where my head was just visiting

---

<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 29, 2020, 12:44am UTC](https://forum.inductiveautomation.com/t/using-a-script-for-writing-to-a-tag-bound-to-a-parameter/35140/4 "2020-05-29T00:44:02Z")

</div>

> [@peter](#):
>
> I’m going to delete this question

Please don't. This sort of thing helps newbies ask questions that they'd be otherwise afraid/ashamed to ask.

---

<div class="post-metadata">

**Author:** ![peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@peter](https://forum.inductiveautomation.com/u/peter)\
**Post date:** [May 29, 2020, 12:46am UTC](https://forum.inductiveautomation.com/t/using-a-script-for-writing-to-a-tag-bound-to-a-parameter/35140/5 "2020-05-29T00:46:54Z")

</div>

OK, I won’t. But the problem wasn’t to do with anything I was asking about and seemed to mysteriously resolved itself. When I fired up my system to confirm that the binding was bidirectional (which I knew it was) it just worked. So from my point of view this question doesn’t;t hold any value.
