Saving undefined record fields as NULL in the DB

Instead of `"undefined"'