Page 1 of 1

Expression compare with null

Posted: Mon Feb 29, 2016 10:25 am
by jimyWeb
Hello,
I have the next expression:
{(listadoHYG_cabecera.fechaFactura == null) ? listadoHYG_cabecera.fechaInicioFmto+" - "+listadoHYG_cabecera.fechaFinFmto: listadoHYG_cabecera.fechaFactura}
I need compare the field fechaFactura with null, but it doesn`t work. The field fechaFactura contains null. How should I use the comparison operator?
Thank you!

Re: Expression compare with null

Posted: Mon Feb 29, 2016 1:14 pm
by HighAley
Hello.

What type of datasource do you use?
Usually, the null values are converted to empty string.

Thank you.

Re: Expression compare with null

Posted: Mon Feb 29, 2016 2:23 pm
by jimyWeb
I use JSON datasource.
I compared it with an empty string and it works. Thank you.

Solution:
{(listadoHYG_cabecera.fechaFactura == "") ? listadoHYG_cabecera.fechaInicioFmto+" - "+listadoHYG_cabecera.fechaFinFmto: listadoHYG_cabecera.fechaFactura}

Re: Expression compare with null

Posted: Tue Mar 01, 2016 10:37 am
by HighAley
Hello.

We are always glad to help you.
Let us know if you need our help.

Thank you.