Ignition Designer - handling Null values

Hi all, I am new here and need help please.

I have this instance that uses UDT Definitions. The tag is a reference, type String, but sometimes it gets a "Null" value when it should be an empty string.

I created a workaround for one specific tag using the IsNull function, and it works well. However, there are hundreds of tags having the same issue.

Is there a way to create a function, condition, or something else within the UDT that would apply to all String tags at once, or would I need to do this directly on each tag? Any tips or suggestions will be appreciated.

Thank you!

Add an expression tag with a coalesce function to the UDT.

coalesce | Ignition User Manual

So, how I would modify the UDT definition:

  • rename the reference tag (e.g. myTag -> myTag_in)
  • add an expression tag with the coalesce named myTag coalesce({[.]myTag_in}, '')

coalesce() returns the first non-null value.

Thanks!

That is pretty much what I have for the UDT tag except that I'm using IsNull, but I was wondering if there is other way to propagate or maybe a configuration that recognized empty string as empty instead of NULL.

Ah. I think i may have misread. You have hundreds of strings in a single UDT?

My mistake, I was not clear. There are hundreds of strings spread out on several UDTs. If there is a way to configure the UDT to handle the Null instead of a tag inside of UDT, it will be a lot easier to update the UDTs than each string tag in the UDT.

There is not.