nullFormat style property for label

Hi!

Is there a different way from a binding script to be able to show nothing when the text is null?

I have a label and I want to show nothing instead of null when null is received.
Any idea? In table columns exists a property that is called "nullFormat" and allows you to show it as you wish.

Current aproach is using a binding expression script:
if(isNull({value}), "", {value})

Thx!

coalesce({value}, "")

A little cleaner? Otherwise, I suspect not.

Where is the null coming from? If it's an SQL query then it could be replaced there.

from a tag. Is an indirect path.

Show us the tag binding / configuration.

This is what I would do in the expression binding it will also handle error as well.

if({[default]New Tag 1.Quality} != "Good" || isNull({[default]New Tag 1}), "", {[default]New Tag 1})

You would be better off doing:

if(isBadOrError({[default]New Tag 1}),"", coalesce({[default]New Tag 1}, "")

This handles all varients of Good quality, which will not all match the string "Good".

3 Likes

My question is not about the binding, is about a style property. Is there a property that when null recieved prints "blank? Same as the nullFormat in table columns.

You may be able to apply the 'empty' pseudo class in the stylesheet, and have it set the content, but generally you would need Javascript to do this reliably.