# Transform the value of a reference tag with a script

**URL:** <https://forum.inductiveautomation.com/t/transform-the-value-of-a-reference-tag-with-a-script/57519>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [March 23, 2022, 11:55am UTC](https://forum.inductiveautomation.com/t/transform-the-value-of-a-reference-tag-with-a-script/57519 "2022-03-23T11:55:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamesennis](https://avatars.discourse-cdn.com/v4/letter/j/ea5d25/32.png) [@jamesennis](https://forum.inductiveautomation.com/u/jamesennis)\
**Post date:** [March 23, 2022, 11:55am UTC](https://forum.inductiveautomation.com/t/transform-the-value-of-a-reference-tag-with-a-script/57519/1 "2022-03-23T11:55:25Z")

</div>

Hello,

I am wondering whether there is a good way to transform the value of a reference tag using a Python script? Just like we can do with property bindings in Perspective.

As an example, let’s say I have the memory tag `memory_tag` with value `'foo,bar,baz'`.  
I’ve created a reference tag (let’s call it `'reference_tag'`) where I want the value to simply be `'bar'` and I want to achieve this with a Python script.

Something like:

```auto
currentValue.value.split(',')[1]

```

(I think this would be possible with expression tags however because the actual value of my memory tag is pretty complicated and often changes in structure I have a strong preference to use a Python script here).

Any suggestions would be hugely appreciated!

---

<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:** [March 23, 2022, 12:01pm UTC](https://forum.inductiveautomation.com/t/transform-the-value-of-a-reference-tag-with-a-script/57519/2 "2022-03-23T12:01:32Z")

</div>

You could make it a memory tag instead, and write to it with a `valueChanges` script event on your base tag.

---

<div class="post-metadata">

**Author:** ![jamesennis](https://avatars.discourse-cdn.com/v4/letter/j/ea5d25/32.png) [@jamesennis](https://forum.inductiveautomation.com/u/jamesennis)\
**Post date:** [March 23, 2022, 12:29pm UTC](https://forum.inductiveautomation.com/t/transform-the-value-of-a-reference-tag-with-a-script/57519/3 "2022-03-23T12:29:10Z")

</div>

Thanks Pascal.
