Access to tag provider string inside expression tag

I am trying to determine if there is any way to access the tag provider string inside the expression of an UDT expression tag. I want to pass this string to a script that needs to know the tag provider because it will be running in gateway scope and i want to limit it to only the tag provider of the tag which called the script.

For tag event scripts, this is not an issue as the tagPath parameter includes the tag provider. But inside UDT expression tags the PathToTag parameter omits the tag provider.

I know that the [~] and [.] relative paths can be used to reference tags, but i have not found a way to access the tag provider portion of these relative paths.

I am also aware that gateway event scripts could likely solve this issue, but for other architecture reasons, I am trying to keep these functionality contained in the tag system.

1 Like

I was able to get just the provider with this expression:

left(
{[.]../TestTag.Path},
indexOf(trim({[.]../TestTag.Path}), "]") + 1
)

Adding .Path to the end of the relative path [within the braces] will return the entire tag path as a string. From there, it's a simple matter of expression language string manipulation to return everything to the left of one index more than the index where the "]" character is located.

1 Like

Thanks so much. {[.].path} will even return just the tag provider without any additional string manipulation.

2 Likes