Page 1 of 1

Velocity test for binary data

PostPosted: Mon Apr 26, 2021 4:41 pm
by wouter
Hi,

In a Velocity template I need to test for content in a binary column. The column is part of the dataset and all I need is to know if it contains data. With other datatypes I would simply test this by calling the variale

e.d.

#if($column)
<do something>
#end

but for the binary column I can nog get this to work.

I have tried

#if($binary_column)
#if($binary_column != '')
#if($binary_column.length >0)

but none seem to have an effect.

How do I test for this?

Wouter.

Re: Velocity test for binary data

PostPosted: Mon Apr 26, 2021 7:10 pm
by ptalbot
Try using:
Code: Select all
$null.isNull($yourVariable)

or
Code: Select all
$null.isNotNull($yourVariable)

Re: Velocity test for binary data

PostPosted: Wed Apr 28, 2021 11:39 am
by wouter
Hi Patrick,

That did the trick. Thanks!

Wouter.