An alternative approach: Try to set datatables columns.defaultContent to handle null or undefined value. See Example: https://datatables.net/reference/option/columns.defaultContent