Displaying a table value

I’m trying to display the value in a particular column of a table. The value can be either blank (the value in the database is NULL) or an integer.

If I try to use an expression like {Root Container.Table.data}[{Root Container.Table.selectedRow},3]it complains that the type of the expression is an object.

If I try toInt({Root Container.Table.data}[{Root Container.Table.selectedRow},3])it doesn’t throw an error or display a blank when the cell is empty, it displays the integer value from the cell to the left :open_mouth:

Al

Let me get this straight. When binding into a table, if the contents of the target cell is non-null, it is displayed correctly, but if it is null, it takes the value from columnIndex-1?
:scratch:

This was a weird one. I bound the expression to a dynamic property and was monitoring it using the Property Editor with the Designer in runtime - when the target cell was null, it showed an incorrect value. When I linked the dynamic property to a label on the window, its value was correct.

If I wanted to check for the possibility of a null value being returned, even though the value was an integer I found that it was better to convert the cell value to a string and check whether it was equal to ‘None’.

Al

You can check for null (= null) in the expression language, or use coalesce to protect against it.