handle field types, flag to discard null values