KB-1253 Null values are stored as empty strings when writing CDT fields to a database

Symptoms

When saving the values of a CDT to a database, a NULL value is not stored as NULL - instead, it is stored as an empty string ‘’.

Cause

Appian converts any NULL values of a CDT text field into an empty string. Writing an empty string to the database is safer than writing NULL value; a NULL value if not handled correctly can lead to NULL pointer exceptions.

Workaround

When comparing values returned from a data store, use lenb() to check the length in bytes is 0 which would be the equivalent of a NULL value. More information on the lenb() function can be found here.

Affected Versions

This article applies to all versions of Appian.

Last Reviewed: March 2017

Related
Recommended