Indirect tag in an expression binding?

Can you use an indirect tag in an expression binding? How would I create that?

Use a custom property to perform the indirect tag binding, then use that property in the expression.

2 Likes

don't use the tag expression function, if you do end up finding this function. This should only ever be used in expression tag expressions:

1 Like

So I have a tag that has a tag path of [default]sitename/folder/tagname
and I want the sitename portion of the tag path to be replaced with an indirect reference to the root containers name property. Then I want to use an expression binding with

[default]{1}/foldername/tagname && [default]{1}/foldername/tagname.quality

{1} = rootcontainer.name

This is for a visibility binding. If the tag has a true value and has good quality then the component will be visible. The tag path reference to the root container name allows me to switch between multiple sites easily by just renaming the root container.

I saw the recommendation to use a custom property to set the indirect tag but I'm not sure how to do that.

Alternatively could I just write that logical AND expression in the indirect binding section?

In your custom prop, use an indirect tag binding to your tag. In your visible prop, use an expression binding that applies your conditions using the custom prop value

what's wrong with the tag() function?

There are many other posts like this

Good to know. I agree with Transistor's comment on that post. This should be something included in the docs.

I guess I'll spend some time hunting for tag() functions today

2 Likes