I have a number of custom fields. Quite a lot of them are yes select option answers. However a number of contacts have what I think is a null value in them.

So if I search give me everyone who has a yes in the field answer I get the answer 579 for example. If I search is not null I get a much higher value eg 1179.

Does anyone know where his data comes from and what it is? If I get rid of it will it just come back?

The reason I am asking is that I am building a chart in Views where I want to display multiple custom fields in a bar chart. As I am trying to display multiple values I can't filter the data for each custom field rather I am relying on the fact that there is data in the field at all to act as the filter and to ensure an accurate count.

I hope I have explained myself properly!

Thank you!

  • search with not null include both results with No and Yes. Thus the number is higher than just Yes. May 2, 2016 at 9:58
  • Thanks do you know What is the difference between not null and not empty ?
    – Caroline B
    May 2, 2016 at 10:24
  • Null is actually a value, a field that has a null value is not empty. So searching for not empty will result in records that have null too. May 2, 2016 at 15:27

2 Answers 2


Assuming you're using Views - [noticed the tag]! You're definitively on the right track! Drupal Views integration is an extremely powerful way to get more out of your CiviCRM (literally!).

So to handle this add a Filter in Views to not display such NULL results. Here's an example where I want to make sure that addresses without a Latitude or Longitude do NOT get plotted on a Map:

enter image description here


Since you are Doing Customization, I Suggest that you have a look at the Search Builder because it gives you the possibility define your own search and arrange the criteria according to your own particular needs as opposed to Advanced search which lets you choose from a wide range of criteria in a user friendly manner.

You can read more about Search Builder here Searching in CiviCRM

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.