I canât explain why your [~] relative reference is breaking.
Ignoring the good advice to translate as much as possible in the UI (even if POU is outside Ignition)âŚ
Side note: I would put the entire path to the enumeration table in the custom property, instead of just a part of the path. I would want the flexibility to look at the enum table wherever it exists in the tag database, be able to utilize relative referencing ([.], [~], etc.), and not be confined to a single folder of a provider. Additionally, I typically prefer an array tag, except for cases where large gaps in the enum table exist (an Engine Annunciator Fault Code table, for example). I would not utilize any script to perform this transform, regardless of UI-based or tag-based solution. I would also use an expression tag, not a derived tag, as I canât envision a reason to ever write a value back to this (or the source) tag. To each-their-own here.
See below for a good reference to options for building tag paths within expressions:
Near the bottom, youâll see the syntax to reference a custom property of âthis tagâ (hereon, âthisâ will refer to a tag that is intended to contain the resultant string post-lookup):
{this.name}
To retrieve your custom property from âthis tagâ:
{this.myCustomProperty}
To have access to the enum table (assuming its entire path is contained in the value of âmyCustomPropertyâ), wrap the value of the prop in a tag() expression:
tag({this.myCustomProperty})
To access a specific row of the array tag:
tag({this.myCustomProperty})[<row_number>]
If using another tagâs value (in this example, the tagâs name is âEnumValueâ, residing in the same folder)
tag({this.myCustomProperty})[{[.]EnumValue}]
To access a specific row & column of a dataset tag:
tag({this.myCustomProperty})[<Row_Index>, <"Column_Name" -OR- Column_Index>
tag({this.myCustomProperty})[{[.]EnumValue.value}, "Text"]
Or, if there are gaps in your dataset, and you must use lookup:
lookup(tag({this.myCustomProperty}), {[.]EnumValue.value}, âERRORâ, "Value", "Text")
You can also substitute column indexes if desired: âValueâ â> 0, and âTextâ â> 1.
With the above, a âmyCustomPropertyâ value of either â[~]âŚâ or â[]âŚâ should function as expected.