Set error code string based on error code number (from Dataset)

I'm pretty sure someone has shared a solution but I haven't been able to find it on the forums.
I'm trying to set a string tag based on an error code integer. At this point I figured using a dataset would be pretty easy as anyone can manually enter the values into the dataset. I also assume that a value change script on the integer tag that sets the string tag is the correct way; if I'm wrong, I will happily use other suggested methods.
My initial idea is to get the range of the dataset and iterate through the first column with an if statement, and set the text string equal to the second row if the first row code matches the integer value. unfortunately I am just starting out with the syntax and don't really know how to structure it. Any help would be appreciated. I'll update this as it progresses.


Consider a sibling expression tag using the lookup() expression function.

If you don't have many tags, the sibling expression tag is the simplest solution. If you have a whole bunch of these, consider not wasting the CPU time looking these up for them all, all of the time. Instead, use that expression in your user interface on a property binding, so you are only computing it for the one you are looking at.

1 Like

That's an option. is there a performance advantage to using an expression tag vs a value change?

Yes, a significant one. Expressions are a lot faster than scripts.

1 Like

I'll give this a shot and update with the results.