Transform the value of a reference tag with a script


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:


(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!

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

Thanks Pascal.