Action Performed set tag value: can you use indirect tag

Can one use indirect tags in the ‘set tag value’ tag under Action Performed? I do not understand the syntax. Other functions are much straight forward with links to tags and component properties.

in the expression builder the way you would use indirect tag binding is with the tag expression. For example, if you had the tags “Bob1_extension”, “Bob2_extension”, and “Bob3_extension” in a folder called “myFolder” then in the expression builder (that’s your action performed script editor area) then you could reference any tag using the tag expression like this:

tag("myFolder/Bob1_extension")

To make it dynamic lets say you had a custom property called BobNum that was either 1, 2, or 3. Then you could create the tag path like so

tag("myFolder/Bob" + {Root Container.BobNum} + "_extension"

Note, on a template, instead of it being Root Container, it will be the name of your template.

Now all that said, what I typically do is create a Template Parameter Custom Property named something like “BaseName” that’s a string. Then I assign to that tag the base tag path I.e. “myFolder/Bob1” or “myFolder/Bob2”. Then I create a Internal Property Custom Property for each of my extensions that I bind using the indirect tag binding method (i.e. {1}_extension with the {1} bound to Root Container.BaseName) Then I can directly reference the custom property in my scripts.

Ideally this results in less scripts having to execute, instead of it having to execute the tag() expression to evaluate a script it just looks at the bound tag. At the very least it makes for much cleaner scripts that are easier to read.

1 Like

Thanks. This is our first ignition project so learning a lot as we go. You cleaned up the expression for me.