Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

So for example I have field 'TestField' which is indexed. How can I caml for items where 'TestField' value is null? My example down here will fail and won't find what I am querying for.

<Where>
   <IsNull>
      <FieldRef Name='TestField' />
   </IsNull>
</Where>

In internet I only found people complaining about this problem but couldn't find any answer.

share|improve this question
1  
As workaround I can propose using default value for those field, say "empty". On views you can modify xsl transformation, so it will replace value "empty" with empty string, but in CAML you can use query where TestField = "empty" –  Kai Mar 24 '13 at 19:54
    
Seems to be the same as stackoverflow.com/questions/1341289/… –  Dave Paylor Mar 24 '13 at 23:54
    
I needed fast solution, so I ended up with getting all list data as DataTable and then using linq to get rows where my desired field value was null. There is just that I don't know how good performance is in my solution. But Kai's idea I think culd be very good, because then it's possible to caml for null values also in views. Looks like there isn't good looking solution... –  Helminth Mar 29 '13 at 17:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.