Dynamic Tag Path

I’m trying to create a custom tag path based on custom parameters.

The following works…

tag("[MQTT Engine]/Edge Nodes/Cabinets/BB-003/Info/Alarm")

The following doesn’t

tag("[MQTT Engine]/Edge Nodes/Cabinets/{view.params.id}/Info/Alarm")

view.params.id = BB-003

I assume I’m missing some kind of formatting but cant figure out what it is. This is for a expression on a label.

Thankyou

You have to concatenate your tag path with the variable. Right now the whole tag path is a literal string.

tag(“firstPartOfPath/” + view.params.id + “/endOfPath”

Yes. If this is for a binding, consider using an indirect binding instead of the tag expression for better performance.

1 Like

Indirect Tag did the trick…

[MQTT Engine]Edge Nodes/Cabinets/{Serial}/Info/Device Info/Last Data Message Size

Then you define {Serial} in the property box underneath.

1 Like