"NaN" appears when using spacebar to denote empty cell in pavlovia

There are two options. The following needs the code component to be above the text component set to $displayText Each Repeat.

displayText=columnName
if displayText=='x':
     displayText=' '

The alternative needs the code component to be below the text component and set to columnName Each Repeat.

if columnName=='x';
     text_component.text=' '