# Using script to write to a few tags after a value is entered into a text field

**URL:** <https://forum.inductiveautomation.com/t/using-script-to-write-to-a-few-tags-after-a-value-is-entered-into-a-text-field/43640>\
**Category:** Ignition\
**Tags:** perspective, scripting\
**Created:** [February 19, 2021, 9:37pm UTC](https://forum.inductiveautomation.com/t/using-script-to-write-to-a-few-tags-after-a-value-is-entered-into-a-text-field/43640 "2021-02-19T21:37:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael.black](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@michael.black](https://forum.inductiveautomation.com/u/michael.black)\
**Post date:** [February 19, 2021, 9:37pm UTC](https://forum.inductiveautomation.com/t/using-script-to-write-to-a-few-tags-after-a-value-is-entered-into-a-text-field/43640/1 "2021-02-19T21:37:42Z")

</div>

I have a text field that I would like to put a script on which would write that value entered into a few tags defined in the script. I know in vision you can use the propertychange event handler but I do not see anything like that in perspective. How would I go about doing this in perspective?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [February 19, 2021, 10:03pm UTC](https://forum.inductiveautomation.com/t/using-script-to-write-to-a-few-tags-after-a-value-is-entered-into-a-text-field/43640/2 "2021-02-19T22:03:26Z")

</div>

If you right-click the property in question, you should see “Add Change Script” in the context menu.

 ![Screen Shot 2021-02-19 at 2.03.10PM](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/7/57d97df9cbcff0bd6a5b61da5f1c264ecdaa60b3.png)  
You would want to do something like this in the script:

```auto
paths = [
    'pathOne/MyTag',
    'pathTwo/MyOtherTag'
]
values = [currentValue.value for path in paths]
system.tag.writeBlocking(paths, values)

```

---

<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:** [February 19, 2021, 10:20pm UTC](https://forum.inductiveautomation.com/t/using-script-to-write-to-a-few-tags-after-a-value-is-entered-into-a-text-field/43640/3 "2021-02-19T22:20:00Z")

</div>

What about

```auto
values = [currentValue.value]*len(paths) 

```

😁

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [February 19, 2021, 10:28pm UTC](https://forum.inductiveautomation.com/t/using-script-to-write-to-a-few-tags-after-a-value-is-entered-into-a-text-field/43640/4 "2021-02-19T22:28:53Z")

</div>

```auto
paths = ['a', 'b']
values = ['x' for path in paths]
print(values)
['x', 'x']
values = ['x'] * len(paths)
print(values)
['x', 'x']

```

Same result.
