Get name from folder in Tag Browser

Hi everyone,

I have a some naming conventions associated with how I built my folder hierarchy in the tag browser and I was wondering if you could get to folder names through expressions.

Hopefully the attached pic helps show what I want to do. In it, I have a data type called Test_Machine. Instead of giving that datatype Line_ID and Machine_ID parameters that I have to type in myself for every instance, I want them to have expression properties whose values come from the number at the end of the parent and parent’s parent folder. This way, simply creating a data type in a particular location would be enough for it to describe itself. So if you read down, the current null values would be:

1
1

1
2

1
3

Thanks in advance,
Steve

This thread should get you started

inductiveautomation.com/forum/v … lit=+parse

Hi,

Thanks for the reply. I saw that thread when cruising the forum before posting and unless I missed something (quite possible!) I don’t think it’s what I’m after.

You have a tag path hard-coded and then correctly state there are a million ways to parse strings. But how could I get that string dynamically based on where my data type instance is? I want an expression tag in my Test_Machine data type that would display the values “Test_Machine_1”, “Test_Line_1”, “Test_Machine_2”, “Test_Line_1”, etc. but don’t know if the text from folders is accessible.

If it’s possible I’d then need to use the Expression language and not Python. I don’t think that would be a problem with either Strings expression functions or runScript and will cross that bridge if I get to it.

if you are using templates and UDT then there is a tag folder on the UDT called META, that contains the Tag Name and Tag Path.

[attachment=0]UDTMeta.PNG[/attachment]

That’s the data I’m after but it wouldn’t just be in templates. I would be using these tags in other places like transaction groups.

It’s not the end of the world if it can’t be done. I have the opportunity to start with a clean slate on a new project and thought this would be better than what I’m currently doing which is overwriting a memory tag for each instance of a UDT.

I just had a play with this to see if I could so it, it should be easy to get the tagpath of a tag, but its not. Its not a tag attribute and there is no expression to retrieve it. Interesting, perhaps its a good candidate for a suggestion, it could be very useful.

Thanks for the sanity check. I too thought it would be easy and I was just missing something obvious :scratch: